added new datepicker to amendments gui
[openemr.git] / interface / reports / patient_flow_board_report.php
blobe197a01d6bfc6e999a1f9b8f044963828483527e
1 <?php
2 /*
3 * Patient Flow Board (Patient Tracker) (Report Based on the appointment report)
5 * This program used to select and print the information captured in the Patient Flow Board program ,
6 * allowing the user to select and print the desired information.
8 * Copyright (C) 2015 Terry Hill <terry@lillysystems.com>
9 * Copyright (C) 2017 Brady Miller <brady.g.miller@gmail.com>
11 * LICENSE: This program is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License
13 * as published by the Free Software Foundation; either version 3
14 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
22 * @package OpenEMR
23 * @author Terry Hill <terry@lilysystems.com>
24 * @author Brady Miller <brady.g.miller@gmail.com>
25 * @link http://www.open-emr.org
28 $fake_register_globals=false;
29 $sanitize_all_escapes=true;
31 require_once("../globals.php");
32 require_once("../../library/patient.inc");
33 require_once("$srcdir/formatting.inc.php");
34 require_once "$srcdir/options.inc.php";
35 require_once "$srcdir/appointments.inc.php";
36 require_once("$srcdir/patient_tracker.inc.php");
38 $patient = $_REQUEST['patient'];
40 if ($patient && ! $_POST['form_from_date']) {
41 # This sets the dates in the date select calendars
42 # If a specific patient, default to 2 years ago.
43 $tmp = date('Y') - 2;
44 $from_date = date("$tmp-m-d");
45 } else {
46 $from_date = fixDate($_POST['form_from_date'], date('Y-m-d'));
47 $to_date = fixDate($_POST['form_to_date'], date('Y-m-d'));
50 # check box information
51 $chk_show_details = false;
52 if ( $_POST['show_details'] ) {
53 $chk_show_details = true;
56 $chk_show_drug_screens = false;
57 if ( $_POST['show_drug_screens'] ) {
58 $chk_show_drug_screens = true;
61 $chk_show_completed_drug_screens = false;
62 if ( $_POST['show_completed_drug_screens'] ) {
63 $chk_show_completed_drug_screens = true;
66 # end check box information
68 $provider = $_POST['form_provider'];
69 $facility = $_POST['form_facility']; #(CHEMED) facility filter
70 $form_orderby = getComparisonOrder( $_REQUEST['form_orderby'] ) ? $_REQUEST['form_orderby'] : 'date';
71 if ($_POST["form_patient"])
72 $form_patient = isset($_POST['form_patient']) ? $_POST['form_patient'] : '';
73 $form_pid = isset($_POST['form_pid']) ? $_POST['form_pid'] : '';
74 if ($form_patient == '' ) $form_pid = '';
77 <html>
79 <head>
80 <?php html_header_show();?>
82 <link rel="stylesheet" href="<?php echo $css_header;?>" type="text/css">
83 <link rel="stylesheet" href="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.min.css">
85 <title><?php echo xlt('Patient Flow Board Report'); ?></title>
87 <script type="text/javascript" src="../../library/overlib_mini.js"></script>
88 <script type="text/javascript" src="../../library/textformat.js?v=<?php echo $v_js_includes; ?>"></script>
89 <script type="text/javascript" src="../../library/dialog.js?v=<?php echo $v_js_includes; ?>"></script>
90 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-min-3-1-1/index.js"></script>
91 <script type="text/javascript" src="<?php echo $GLOBALS['assets_static_relative']; ?>/jquery-datetimepicker-2-5-4/build/jquery.datetimepicker.full.min.js"></script>
93 <script type="text/javascript">
95 var mypcc = '<?php echo $GLOBALS['phone_country_code'] ?>';
97 $(document).ready(function() {
98 var win = top.printLogSetup ? top : opener.top;
99 win.printLogSetup(document.getElementById('printbutton'));
101 $('.datepicker').datetimepicker({
102 <?php $datetimepicker_timepicker = false; ?>
103 <?php $datetimepicker_formatInput = false; ?>
104 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
105 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
109 function dosort(orderby) {
110 var f = document.forms[0];
111 f.form_orderby.value = orderby;
112 f.submit();
113 return false;
116 // CapMinds :: invokes find-patient popup.
117 function sel_patient() {
118 dlgopen('../main/calendar/find_patient_popup.php?pflag=0', '_blank', 500, 400);
121 // CapMinds :: callback by the find-patient popup.
122 function setpatient(pid, lname, fname, dob) {
123 var f = document.theform;
124 f.form_patient.value = lname + ', ' + fname;
125 f.form_pid.value = pid;
129 </script>
131 <style type="text/css">
132 /* specifically include & exclude from printing */
133 @media print {
134 #report_parameters {
135 visibility: hidden;
136 display: none;
138 #report_parameters_daterange {
139 visibility: visible;
140 display: inline;
142 #report_results table {
143 margin-top: 0px;
147 /* specifically exclude some from the screen */
148 @media screen {
149 #report_parameters_daterange {
150 visibility: hidden;
151 display: none;
154 </style>
155 </head>
157 <body class="body_top">
159 <!-- Required for the popup date selectors -->
160 <div id="overDiv"
161 style="position: absolute; visibility: hidden; z-index: 1000;"></div>
162 <?php if ($GLOBALS['drug_screen']) { #setting the title of the page based o if drug screening is enabled ?>
163 <span class='title'><?php echo xlt('Patient Flow Board'); ?> - <?php echo xlt('Drug Screen Report'); ?></span>
164 <?php } else { ?>
165 <span class='title'><?php echo xlt('Patient Flow Board Report'); ?></span>
166 <?php } ?>
169 <div id="report_parameters_daterange"><?php echo date("d F Y", strtotime($from_date)) ." &nbsp; to &nbsp; ". date("d F Y", strtotime($to_date)); #sets date range for calendars ?>
170 </div>
172 <form method='post' name='theform' id='theform' action='patient_flow_board_report.php' onsubmit='return top.restoreSession()'>
174 <div id="report_parameters">
176 <table>
177 <tr>
178 <td width='650px'>
179 <div style='float: left'>
181 <table class='text'>
182 <tr>
183 <td class='label'><?php echo xlt('Facility'); ?>:</td>
184 <td><?php dropdown_facility($facility, 'form_facility'); ?>
185 </td>
186 <td class='label'><?php echo xlt('Provider'); ?>:</td>
187 <td><?php
189 # Build a drop-down list of providers.
192 $query = "SELECT id, lname, fname FROM users WHERE ".
193 "authorized = 1 ORDER BY lname, fname"; #(CHEMED) facility filter
195 $ures = sqlStatement($query);
197 echo " <select name='form_provider'>\n";
198 echo " <option value=''>-- " . xlt('All') . " --\n";
200 while ($urow = sqlFetchArray($ures)) {
201 $provid = $urow['id'];
202 echo " <option value='" . attr($provid) . "'";
203 if ($provid == $_POST['form_provider']) echo " selected";
204 echo ">" . text($urow['lname']) . ", " . text($urow['fname']) . "\n";
207 echo " </select>\n";
209 ?></td>
211 </tr>
213 <tr>
214 <td class='label'><?php echo xlt('From'); ?>:</td>
215 <td><input type='text' name='form_from_date' id="form_from_date"
216 class='datepicker'
217 size='10' value='<?php echo attr($from_date) ?>'
218 title='yyyy-mm-dd'>
219 </td>
220 <td class='label'><?php echo xlt('To'); ?>:</td>
221 <td><input type='text' name='form_to_date' id="form_to_date"
222 class='datepicker'
223 size='10' value='<?php echo attr($to_date) ?>'
224 title='yyyy-mm-dd'>
225 </td>
226 </tr>
228 <tr>
229 <td class='label'><?php echo xlt('Status'); # status code drop down creation ?>:</td>
230 <td><?php generate_form_field(array('data_type'=>1,'field_id'=>'apptstatus','list_id'=>'apptstat','empty_title'=>'All'),$_POST['form_apptstatus']);?></td>
231 <td><?php echo xlt('Category') #category drop down creation ?>:</td>
232 <td>
233 <select id="form_apptcat" name="form_apptcat">
234 <?php
235 $categories=fetchAppointmentCategories();
236 echo "<option value='ALL'>".xlt("All")."</option>";
237 while($cat=sqlFetchArray($categories))
239 echo "<option value='".attr($cat['id'])."'";
240 if($cat['id']==$_POST['form_apptcat'])
242 echo " selected='true' ";
244 echo ">".text(xl_appt_category($cat['category']))."</option>";
247 </select>
248 </td>
249 </tr>
250 <tr>
251 <td>
252 &nbsp;&nbsp;<span class='text'><?php echo xlt('Patient'); ?>: </span>
253 </td>
254 <td>
255 <input type='text' size='20' name='form_patient' style='width:100%;cursor:pointer;cursor:hand' value='<?php echo attr($form_patient) ? attr($form_patient) : xla('Click To Select'); ?>' onclick='sel_patient()' title='<?php echo xla('Click to select patient'); ?>' />
256 <input type='hidden' name='form_pid' value='<?php echo attr($form_pid); ?>' />
257 </td>
259 <td colspan="2"><label><input type="checkbox" name="show_details" id="show_details" <?php if($chk_show_details) echo "checked";?>>&nbsp;<?php echo xlt('Show Details'); ?></label></td>
260 </tr>
261 <tr>
263 </tr>
264 <?php if ($GLOBALS['drug_screen']) { ?>
265 <tr>
266 <?php # these two selects will are for the drug screen entries the Show Selected for Drug Screens will show all
267 # that have a yes for selected. If you just check the Show Status of Drug Screens all drug screens will be displayed
268 # if both are selected then only completed drug screens will be displayed. ?>
269 <td colspan="2"><label><input type="checkbox" name="show_drug_screens" id="show_drug_screens" <?php if($chk_show_drug_screens) echo "checked";?>>&nbsp;<?php echo xlt('Show Selected for Drug Screens'); ?></label></td>
270 <td colspan="2"><label><input type="checkbox" name="show_completed_drug_screens" id="show_completed_drug_screens" <?php if($chk_show_completed_drug_screens) echo "checked";?>>&nbsp;<?php echo xlt('Show Status of Drug Screens'); ?></label></td>
271 </tr>
272 <?php } ?>
274 </table>
276 </div>
278 </td>
279 <td align='left' valign='middle' height="100%">
280 <table style='border-left: 1px solid; width: 100%; height: 100%'>
281 <tr>
282 <td>
283 <div style='margin-left: 15px'>
284 <a href='#' class='css_button' onclick='$("#form_refresh").attr("value","true"); $("#theform").submit();'>
285 <span> <?php echo xlt('Submit'); ?> </span> </a>
286 <?php if ($_POST['form_refresh'] || $_POST['form_orderby'] ) { ?>
287 <a href='#' class='css_button' id='printbutton'>
288 <span> <?php echo xlt('Print'); ?> </span> </a>
289 <?php } ?>
290 </div>
291 </td>
292 </tr>
293 <tr>&nbsp;&nbsp;<?php echo xlt('Most column headers can be clicked to change sort order') ?></tr>
294 </table>
295 </td>
296 </tr>
297 </table>
299 </div>
300 <!-- end of search parameters --> <?php
301 if ($_POST['form_refresh'] || $_POST['form_orderby']) {
303 <div id="report_results">
304 <table>
306 <thead>
307 <?php if (!$chk_show_drug_screens && !$chk_show_completed_drug_screens) { # the first part of this block is for the Patient Flow Board report ?>
308 <th><a href="nojs.php" onclick="return dosort('doctor')"
309 <?php if ($form_orderby == "doctor") echo " style=\"color:#00cc00\"" ?>><?php echo xlt('Provider'); ?>
310 </a></th>
312 <th><a href="nojs.php" onclick="return dosort('date')"
313 <?php if ($form_orderby == "date") echo " style=\"color:#00cc00\"" ?>><?php echo xlt('Date'); ?></a>
314 </th>
316 <th><a href="nojs.php" onclick="return dosort('time')"
317 <?php if ($form_orderby == "time") echo " style=\"color:#00cc00\"" ?>><?php echo xlt('Time'); ?></a>
318 </th>
320 <th><a href="nojs.php" onclick="return dosort('patient')"
321 <?php if ($form_orderby == "patient") echo " style=\"color:#00cc00\"" ?>>&nbsp;&nbsp;&nbsp;<?php echo xlt('Patient'); ?></a>
322 </th>
324 <th><a href="nojs.php" onclick="return dosort('pubpid')"
325 <?php if ($form_orderby == "pubpid") echo " style=\"color:#00cc00\"" ?>>&nbsp;<?php echo xlt('ID'); ?></a>
326 </th>
328 <th><a href="nojs.php" onclick="return dosort('type')"
329 <?php if ($form_orderby == "type") echo " style=\"color:#00cc00\"" ?>><?php echo xlt('Type'); ?></a>
330 </th>
332 <?php if ($chk_show_details) { ?>
333 <th><a href="nojs.php" onclick="return dosort('trackerstatus')"
334 <?php if ($form_orderby == "trackerstatus") echo " style=\"color:#00cc00\"" ?>><?php echo xlt('Status'); ?></a>
335 </th>
336 <?php } else { ?>
337 <th><a href="nojs.php" onclick="return dosort('trackerstatus')"
338 <?php if ($form_orderby == "trackerstatus") echo " style=\"color:#00cc00\"" ?>><?php echo xlt('Final Status'); ?></a>
339 </th>
340 <?php } ?>
343 <th><?php
344 if ($chk_show_details) { # not sure if Sorting by Arrive Time is useful
345 echo xlt('Start Time');
347 else
349 echo xlt('Arrive Time');
350 }?></th>
352 <th><?php
353 if ($chk_show_details) { # not sure if Sorting by Discharge Time is useful
354 echo xlt('End Time');
356 else
358 echo xlt('Discharge Time');
359 }?></th>
361 <th><?php echo xlt('Total Time'); # not adding Sorting by Total Time yet but can see that it might be useful ?></th>
363 <?php } else { # this section is for the drug screen report ?>
365 <th><a href="nojs.php" onclick="return dosort('doctor')"
366 <?php if ($form_orderby == "doctor") echo " style=\"color:#00cc00\"" ?>><?php echo xlt('Provider'); ?>
367 </a></th>
369 <th><a href="nojs.php" onclick="return dosort('date')"
370 <?php if ($form_orderby == "date") echo " style=\"color:#00cc00\"" ?>><?php echo xlt('Date'); ?></a>
371 </th>
373 <th><a href="nojs.php" onclick="return dosort('time')"
374 <?php if ($form_orderby == "time") echo " style=\"color:#00cc00\"" ?>><?php echo xlt('Time'); ?></a>
375 </th>
377 <th><a href="nojs.php" onclick="return dosort('patient')"
378 <?php if ($form_orderby == "patient") echo " style=\"color:#00cc00\"" ?>>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo xlt('Patient'); ?></a>
379 </th>
381 <?php if (!$chk_show_completed_drug_screens) { ?>
382 <th><a href="nojs.php" onclick="return dosort('pubpid')"
383 <?php if ($form_orderby == "pubpid") echo " style=\"color:#00cc00\"" ?>>&nbsp;<?php echo xlt('ID'); ?></a>
384 </th>
385 <?php } else { ?>
386 <th><a href="nojs.php" onclick="return dosort('pubpid')"
387 <?php if ($form_orderby == "pubpid") echo " style=\"color:#00cc00\"" ?>>&nbsp;<?php echo xlt('ID'); ?></a>
388 </th>
389 <?php } ?>
391 <th><?php echo xlt('Drug Screen'); # not sure if Sorting by Drug Screen is useful ?></th>
393 <?php if (!$chk_show_completed_drug_screens) { ?>
394 <th>&nbsp;</th>
395 <?php } else { ?>
396 <th><a href="nojs.php" onclick="return dosort('completed')"
397 <?php if ($form_orderby == "completed") echo " style=\"color:#00cc00\"" ?>><?php echo xlt('Completed'); ?></a>
398 </th>
399 <?php } ?>
401 <th></th><th></th><th></th>
403 <?php } ?>
404 </thead>
405 <tbody>
406 <!-- added for better print-ability -->
407 <?php
409 $lastdocname = "";
410 #Appointment Status Checking
411 $form_apptstatus = $_POST['form_apptstatus'];
412 $form_apptcat=null;
413 if(isset($_POST['form_apptcat']))
415 if($form_apptcat!="ALL")
417 $form_apptcat=intval($_POST['form_apptcat']);
421 #Without provider and facility data checking
422 $with_out_provider = null;
423 $with_out_facility = null;
425 # get the appointments also set the trackerboard flag to true (last entry in the fetchAppointments call so we get the tracker stuff)
426 $appointments = fetchAppointments( $from_date, $to_date, $patient, $provider, $facility, $form_apptstatus, $with_out_provider, $with_out_facility,$form_apptcat,true );
427 # sort the appointments by the appointment time
428 $appointments = sortAppointments( $appointments, $form_orderby );
429 # $j is used to count the number of patients that match the selected criteria.
430 $j=0;
431 //print_r2($appointments);
432 foreach ( $appointments as $appointment ) {
433 $patient_id = $appointment['pid'];
434 $tracker_id = $appointment['pt_tracker_id'];
435 $last_seq = $appointment['lastseq'];
436 $docname = $appointment['ulname'] . ', ' . $appointment['ufname'] . ' ' . $appointment['umname'];
437 # only get items with a tracker id.
438 if ($tracker_id == '' ) continue;
439 # only get the drug screens that are set to yes.
440 if ($chk_show_drug_screens ==1 ) {
441 if ($appointment['random_drug_test'] != '1') continue;
443 #if a patient id is entered just get that patient.
444 if (strlen($form_pid) !=0 ) {
445 if ($appointment['pid'] != $form_pid ) continue;
448 $errmsg = "";
449 $newarrive = '';
450 $newend = '';
451 $no_visit = 1;
452 # getting arrive time and end time from the elements file.
453 if ($tracker_id != 0) {
454 $newarrive = collect_checkin($tracker_id);
455 $newend = collect_checkout($tracker_id);
458 if ($newend != '' && $newarrive != '') {
459 $no_visit = 0;
461 $tracker_status = $appointment['status'];
462 # get the time interval for the entire visit. to display seconds add last option of true.
463 # get_Tracker_Time_Interval($newarrive, $newend, true)
464 $timecheck2 = get_Tracker_Time_Interval($newarrive, $newend);
465 # Get the tracker elements.
466 $tracker_elements = collect_Tracker_Elements($tracker_id);
467 # $j is incremented for a patient that made it for display.
468 $j=$j+1;
471 <tr bgcolor='<?php echo $bgcolor ?>'>
472 <?php if (!$chk_show_drug_screens && !$chk_show_completed_drug_screens) { # the first part of this block is for the Patient Flow Board report ?>
473 <td class="detail">&nbsp;<?php echo ($docname == $lastdocname) ? "" : $docname ?>
474 </td>
476 <td class="detail"><?php echo text(oeFormatShortDate($appointment['pc_eventDate'])) ?>
477 </td>
479 <td class="detail"><?php echo text(oeFormatTime($appointment['pc_startTime'])) ?>
480 </td>
482 <td class="detail">&nbsp;<?php echo text($appointment['fname'] . " " . $appointment['lname']) ?>
483 </td>
485 <td class="detail">&nbsp;<?php echo text($appointment['pubpid']) ?>
486 </td>
488 <td class="detail">&nbsp;<?php echo text(xl_appt_category($appointment['pc_catname'])) ?>
489 </td>
491 <td class="detail">
492 <?php
493 //Appointment Status
494 if($chk_show_details) {
495 if($no_visit != 1) {
496 echo xlt('Complete Visit Time');
499 else
501 if($tracker_status != ""){
502 $frow['data_type']=1;
503 $frow['list_id']='apptstat';
504 generate_print_field($frow, $tracker_status);
508 </td>
510 <td class="detail">&nbsp;<?php echo text(substr($newarrive,11)) ?>
511 </td>
513 <td class="detail">&nbsp;<?php echo text(substr($newend,11)) ?>
514 </td>
516 <?php if ($no_visit != 1) { ?>
517 <td class="detail">&nbsp;<?php echo text($timecheck2) ?></td>
518 <?php } else { ?>
519 <td class="detail">&nbsp;</td>
520 <?php } ?>
521 <?php if ($chk_show_details) { # lets show the detail lines
522 $i = '0';
523 $k = '0';
524 for ($x = 1; $x <= $last_seq; $x++) {
526 <tr valign='top' class="detail" >
527 <td colspan="6" class="detail" align='left'>
529 <?php
530 # get the verbiage for the status code
531 $track_stat = $tracker_elements[$i][status];
532 # Get Interval alert time and status color.
533 $colorevents = (collectApptStatusSettings($track_stat));
534 $alert_time = '0';
535 $alert_color = $colorevents['color'];
536 $alert_time = $colorevents['time_alert'];
537 if (is_checkin($track_stat) || is_checkout($track_stat)) { #bold the check in and check out times in this block.
539 <td class="detail"><b>
540 <?php } else { ?>
541 <td class="detail">
542 <?php
544 echo getListItemTitle("apptstat",$track_stat);
546 </b></td>
547 <?php
548 if (is_checkin($track_stat) || is_checkout($track_stat)) { #bold the check in and check out times in this block.
550 <td class="detail"><b>&nbsp;<?php echo text(substr($tracker_elements[$i][start_datetime],11)); ?></b></td>
551 <?php } else { ?>
552 <td class="detail">&nbsp;<?php echo text(substr($tracker_elements[$i][start_datetime],11)); ?></td>
553 <?php # figure out the next time of the status
555 $k = $i+1;
556 if($k < $last_seq) {
557 # get the start time of the next status to determine the total time in this status
558 $start_tracker_time = $tracker_elements[$i][start_datetime];
559 $next_tracker_time = $tracker_elements[$k][start_datetime];
561 else
563 # since this is the last status the start and end are equal
564 $start_tracker_time = $tracker_elements[$i][start_datetime];
565 $next_tracker_time = $tracker_elements[$i][start_datetime];
567 if (is_checkin($track_stat) || is_checkout($track_stat)) { #bold the check in and check out times in this block.
569 <td class="detail"><b>&nbsp;<?php echo text(substr($next_tracker_time,11)) ?></b></td>
570 <?php } else { ?>
571 <td class="detail">&nbsp;<?php echo text(substr($next_tracker_time,11)) ?></td>
572 <?php # compute the total time of the status
574 $tracker_time = get_Tracker_Time_Interval($start_tracker_time, $next_tracker_time);
575 # add code to alert if over time interval for status
576 $timecheck = round(abs( strtotime($start_tracker_time) - strtotime($next_tracker_time)) / 60,0);
577 if($timecheck > $alert_time && ($alert_time != '0')) {
578 if (is_checkin($track_stat) || is_checkout($track_stat)) { #bold the check in and check out times in this block.
580 <td class="detail" bgcolor='<?php echo attr($alert_color) ?>'><b>&nbsp;<?php echo text($tracker_time); ?></b></td>
581 <?php } else { ?>
582 <td class="detail" bgcolor='<?php echo attr($alert_color) ?>'>&nbsp;<?php echo text($tracker_time); ?></td>
583 <?php } ?>
584 <?php } else { if (is_checkin($track_stat) || is_checkout($track_stat)) { #bold the check in and check out times in this block. ?>
585 <td class="detail"><b>&nbsp;<?php echo text($tracker_time); ?></b></td>
586 <?php } else { ?>
587 <td class="detail">&nbsp;<?php echo text($tracker_time); ?></td>
588 <?php
591 $i++;
595 </td>
596 </tr>
598 <?php } else { # this section is for the drug screen report ?>
600 <td class="detail">&nbsp;<?php echo ($docname == $lastdocname) ? "" : $docname ?>
601 </td>
603 <td class="detail"><?php echo text(oeFormatShortDate($appointment['pc_eventDate'])) ?>
604 </td>
606 <td class="detail"><?php echo text(oeFormatTime($appointment['pc_startTime'])) ?>
607 </td>
609 <td class="detail">&nbsp;<?php echo text($appointment['fname'] . " " . $appointment['lname']) ?>
610 </td>
612 <td class="detail">&nbsp;<?php echo text($appointment['pubpid']) ?></td>
614 <td class="detail" align = >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php if ($appointment['random_drug_test'] == '1') { echo xlt('Yes'); } else { echo xlt('No'); }?></td>
616 <?php if ($chk_show_completed_drug_screens) { ?>
617 <td class="detail">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php if ($appointment['drug_screen_completed'] == '1') { echo xlt('Yes'); } else { echo xlt('No'); }?></td>
618 <?php } else { ?>
619 <td class="detail">&nbsp; </td>
620 <?php } ?>
622 <?php # these last items are used to complete the screen ?>
623 <td class="detail">&nbsp;</td>
625 <td class="detail">&nbsp;</td>
627 <td class="detail">&nbsp;</td>
628 <?php } ?>
629 </tr>
631 <?php
632 $lastdocname = $docname;
633 } # end for
635 <tr>
636 <?php if (!$chk_show_drug_screens && !$chk_show_completed_drug_screens) { # is it Patient Flow Board or Drug screen ?>
637 <td colspan="10" align="left"><?php echo xlt('Total number of Patient Flow Board entries'); ?>&nbsp;<?php echo text($j);?>&nbsp;<?php echo xlt('Patients'); ?></td>
638 <?php } else { ?>
639 <td colspan="10" align="left"><?php echo xlt('Total number of Drug Screen entries'); ?>&nbsp;<?php echo text($j);?>&nbsp;<?php echo xlt('Patients'); ?></td>
640 <?php } ?>
641 </tr>
642 </tbody>
643 </table>
644 </div>
645 <!-- end of search results --> <?php } else { ?>
646 <div class='text'><?php echo xlt('Please input search criteria above, and click Submit to view results.' ); ?>
647 </div>
648 <?php } ?> <input type="hidden" name="form_orderby"
649 value="<?php echo attr($form_orderby) ?>" /> <input type="hidden"
650 name="patient" value="<?php echo attr($patient) ?>" /> <input type='hidden'
651 name='form_refresh' id='form_refresh' value='' /></form>
653 </body>
655 </html>