minor changes to prior commit
[openemr.git] / interface / reports / patient_flow_board_report.php
blobb1d7eb70b2ba011ec43208c3acbf1b79edee04d9
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 * @package OpenEMR
9 * @link http://www.open-emr.org
10 * @author Terry Hill <terry@lilysystems.com>
11 * @author Brady Miller <brady.g.miller@gmail.com>
12 * @copyright Copyright (c) 2015 Terry Hill <terry@lillysystems.com>
13 * @copyright Copyright (c) 2017 Brady Miller <brady.g.miller@gmail.com>
14 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
18 require_once("../globals.php");
19 require_once("../../library/patient.inc");
20 require_once "$srcdir/options.inc.php";
21 require_once "$srcdir/appointments.inc.php";
22 require_once("$srcdir/patient_tracker.inc.php");
24 use OpenEMR\Core\Header;
26 $patient = $_REQUEST['patient'];
28 if ($patient && !isset($_POST['form_from_date'])) {
29 // If a specific patient, default to 2 years ago.
30 $tmp = date('Y') - 2;
31 $from_date = date("$tmp-m-d");
32 $to_date = date('Y-m-d');
33 } else {
34 $from_date = isset($_POST['form_from_date']) ? DateToYYYYMMDD($_POST['form_from_date']) : date('Y-m-d');
35 $to_date = isset($_POST['form_to_date']) ? DateToYYYYMMDD($_POST['form_to_date']) : date('Y-m-d');
38 # check box information
39 $chk_show_details = false;
40 if ($_POST['show_details']) {
41 $chk_show_details = true;
44 $chk_show_drug_screens = false;
45 if ($_POST['show_drug_screens']) {
46 $chk_show_drug_screens = true;
49 $chk_show_completed_drug_screens = false;
50 if ($_POST['show_completed_drug_screens']) {
51 $chk_show_completed_drug_screens = true;
54 # end check box information
56 $provider = $_POST['form_provider'];
57 $facility = $_POST['form_facility']; #(CHEMED) facility filter
58 $form_orderby = getComparisonOrder($_REQUEST['form_orderby']) ? $_REQUEST['form_orderby'] : 'date';
59 if ($_POST["form_patient"]) {
60 $form_patient = isset($_POST['form_patient']) ? $_POST['form_patient'] : '';
63 $form_pid = isset($_POST['form_pid']) ? $_POST['form_pid'] : '';
64 if ($form_patient == '') {
65 $form_pid = '';
69 <html>
71 <head>
72 <title><?php echo xlt('Patient Flow Board Report'); ?></title>
74 <?php Header::setupHeader(['datetime-picker', 'report-helper']); ?>
76 <script type="text/javascript">
77 $(document).ready(function() {
78 var win = top.printLogSetup ? top : opener.top;
79 win.printLogSetup(document.getElementById('printbutton'));
81 $('.datepicker').datetimepicker({
82 <?php $datetimepicker_timepicker = false; ?>
83 <?php $datetimepicker_showseconds = false; ?>
84 <?php $datetimepicker_formatInput = true; ?>
85 <?php require($GLOBALS['srcdir'] . '/js/xl/jquery-datetimepicker-2-5-4.js.php'); ?>
86 <?php // can add any additional javascript settings to datetimepicker here; need to prepend first setting with a comma ?>
87 });
88 });
90 function dosort(orderby) {
91 var f = document.forms[0];
92 f.form_orderby.value = orderby;
93 f.submit();
94 return false;
97 // CapMinds :: invokes find-patient popup.
98 function sel_patient() {
99 dlgopen('../main/calendar/find_patient_popup.php?pflag=0', '_blank', 500, 400);
102 // CapMinds :: callback by the find-patient popup.
103 function setpatient(pid, lname, fname, dob) {
104 var f = document.theform;
105 f.form_patient.value = lname + ', ' + fname;
106 f.form_pid.value = pid;
108 </script>
110 <style type="text/css">
111 /* specifically include & exclude from printing */
112 @media print {
113 #report_parameters {
114 visibility: hidden;
115 display: none;
117 #report_parameters_daterange {
118 visibility: visible;
119 display: inline;
121 #report_results table {
122 margin-top: 0px;
126 /* specifically exclude some from the screen */
127 @media screen {
128 #report_parameters_daterange {
129 visibility: hidden;
130 display: none;
133 </style>
134 </head>
136 <body class="body_top">
138 <!-- Required for the popup date selectors -->
139 <div id="overDiv"
140 style="position: absolute; visibility: hidden; z-index: 1000;"></div>
141 <?php if ($GLOBALS['drug_screen']) { #setting the title of the page based o if drug screening is enabled ?>
142 <span class='title'><?php echo xlt('Patient Flow Board'); ?> - <?php echo xlt('Drug Screen Report'); ?></span>
143 <?php } else { ?>
144 <span class='title'><?php echo xlt('Patient Flow Board Report'); ?></span>
145 <?php } ?>
148 <div id="report_parameters_daterange"><?php echo text(oeFormatShortDate($from_date)) ." &nbsp; " . xlt('to') . " &nbsp; ". text(oeFormatShortDate($to_date)); #sets date range for calendars ?>
149 </div>
151 <form method='post' name='theform' id='theform' action='patient_flow_board_report.php' onsubmit='return top.restoreSession()'>
153 <div id="report_parameters">
155 <table>
156 <tr>
157 <td width='650px'>
158 <div style='float: left'>
160 <table class='text'>
161 <tr>
162 <td class='control-label'><?php echo xlt('Facility'); ?>:</td>
163 <td><?php dropdown_facility($facility, 'form_facility'); ?>
164 </td>
165 <td class='control-label'><?php echo xlt('Provider'); ?>:</td>
166 <td><?php
168 # Build a drop-down list of providers.
171 $query = "SELECT id, lname, fname FROM users WHERE ".
172 "authorized = 1 ORDER BY lname, fname"; #(CHEMED) facility filter
174 $ures = sqlStatement($query);
176 echo " <select name='form_provider' class='form-control'>\n";
177 echo " <option value=''>-- " . xlt('All') . " --\n";
179 while ($urow = sqlFetchArray($ures)) {
180 $provid = $urow['id'];
181 echo " <option value='" . attr($provid) . "'";
182 if ($provid == $_POST['form_provider']) {
183 echo " selected";
186 echo ">" . text($urow['lname']) . ", " . text($urow['fname']) . "\n";
189 echo " </select>\n";
191 ?></td>
193 </tr>
195 <tr>
196 <td class='control-label'><?php echo xlt('From'); ?>:</td>
197 <td><input type='text' name='form_from_date' id="form_from_date"
198 class='datepicker form-control'
199 size='10' value='<?php echo attr(oeFormatShortDate($from_date)); ?>'>
200 </td>
201 <td class='control-label'><?php echo xlt('To'); ?>:</td>
202 <td><input type='text' name='form_to_date' id="form_to_date"
203 class='datepicker form-control'
204 size='10' value='<?php echo attr(oeFormatShortDate($to_date)); ?>'>
205 </td>
206 </tr>
208 <tr>
209 <td class='control-label'><?php echo xlt('Status'); # status code drop down creation ?>:</td>
210 <td><?php generate_form_field(array('data_type'=>1,'field_id'=>'apptstatus','list_id'=>'apptstat','empty_title'=>'All'), $_POST['form_apptstatus']);?></td>
211 <td><?php echo xlt('Category') #category drop down creation ?>:</td>
212 <td>
213 <select id="form_apptcat" name="form_apptcat" class="form-control">
214 <?php
215 $categories=fetchAppointmentCategories();
216 echo "<option value='ALL'>".xlt("All")."</option>";
217 while ($cat=sqlFetchArray($categories)) {
218 echo "<option value='".attr($cat['id'])."'";
219 if ($cat['id']==$_POST['form_apptcat']) {
220 echo " selected='true' ";
223 echo ">".text(xl_appt_category($cat['category']))."</option>";
226 </select>
227 </td>
228 </tr>
229 <tr>
230 <td>
231 &nbsp;&nbsp;<span class='text'><?php echo xlt('Patient'); ?>: </span>
232 </td>
233 <td>
234 <input type='text' size='20' name='form_patient' class='form-control' style='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'); ?>' />
235 <input type='hidden' name='form_pid' value='<?php echo attr($form_pid); ?>' />
236 </td>
238 <td colspan="2">
239 <div class="checkbox">
240 <label><input type="checkbox" name="show_details" id="show_details" <?php echo ($chk_show_details) ? "checked" : ""; ?>>&nbsp;<?php echo xlt('Show Details'); ?></label>
241 </div>
242 </td>
243 </tr>
244 <tr>
246 </tr>
247 <?php if ($GLOBALS['drug_screen']) { ?>
248 <tr>
249 <?php # these two selects will are for the drug screen entries the Show Selected for Drug Screens will show all
250 # that have a yes for selected. If you just check the Show Status of Drug Screens all drug screens will be displayed
251 # if both are selected then only completed drug screens will be displayed. ?>
252 <td colspan="2">
253 <div class="checkbox">
254 <label><input type="checkbox" name="show_drug_screens" id="show_drug_screens" <?php echo ($chk_show_drug_screens) ? "checked" : ""; ?>>&nbsp;<?php echo xlt('Show Selected for Drug Screens'); ?></label>
255 </div>
256 </td>
257 <td colspan="2">
258 <div class="checkbox">
259 <label><input type="checkbox" name="show_completed_drug_screens" id="show_completed_drug_screens" <?php echo ($chk_show_completed_drug_screens) ? "checked" : ""; ?>>&nbsp;<?php echo xlt('Show Status of Drug Screens'); ?></label>
260 </div>
261 </td>
262 </tr>
263 <?php } ?>
265 </table>
267 </div>
269 </td>
270 <td align='left' valign='middle' height="100%">
271 <table style='border-left: 1px solid; width: 100%; height: 100%'>
272 <tr>
273 <td>
274 <div class="text-center">
275 <div class="btn-group" role="group">
276 <a href='#' class='btn btn-default btn-save' onclick='$("#form_refresh").attr("value","true"); $("#theform").submit();'>
277 <?php echo xlt('Submit'); ?>
278 </a>
279 <?php if ($_POST['form_refresh'] || $_POST['form_orderby']) { ?>
280 <a href='#' class='btn btn-default btn-print' id='printbutton'>
281 <?php echo xlt('Print'); ?>
282 </a>
283 <?php } ?>
284 </div>
285 </div>
286 </td>
287 </tr>
288 <tr>&nbsp;&nbsp;<?php echo xlt('Most column headers can be clicked to change sort order') ?></tr>
289 </table>
290 </td>
291 </tr>
292 </table>
294 </div>
295 <!-- end of search parameters --> <?php
296 if ($_POST['form_refresh'] || $_POST['form_orderby']) {
298 <div id="report_results">
299 <table>
301 <thead>
302 <?php if (!$chk_show_drug_screens && !$chk_show_completed_drug_screens) { # the first part of this block is for the Patient Flow Board report ?>
303 <th><a href="nojs.php" onclick="return dosort('doctor')"
304 <?php echo ($form_orderby == "doctor") ? " style=\"color:#00cc00\"" : ""; ?>><?php echo xlt('Provider'); ?>
305 </a></th>
307 <th><a href="nojs.php" onclick="return dosort('date')"
308 <?php echo ($form_orderby == "date") ? " style=\"color:#00cc00\"" : ""; ?>><?php echo xlt('Date'); ?></a>
309 </th>
311 <th><a href="nojs.php" onclick="return dosort('time')"
312 <?php echo ($form_orderby == "time") ? " style=\"color:#00cc00\"" : ""; ?>><?php echo xlt('Time'); ?></a>
313 </th>
315 <th><a href="nojs.php" onclick="return dosort('patient')"
316 <?php echo ($form_orderby == "patient") ? " style=\"color:#00cc00\"" : ""; ?>>&nbsp;&nbsp;&nbsp;<?php echo xlt('Patient'); ?></a>
317 </th>
319 <th><a href="nojs.php" onclick="return dosort('pubpid')"
320 <?php echo ($form_orderby == "pubpid") ? " style=\"color:#00cc00\"" : ""; ?>>&nbsp;<?php echo xlt('ID'); ?></a>
321 </th>
323 <th><a href="nojs.php" onclick="return dosort('type')"
324 <?php echo ($form_orderby == "type") ? " style=\"color:#00cc00\"" : ""; ?>><?php echo xlt('Type'); ?></a>
325 </th>
327 <?php if ($chk_show_details) { ?>
328 <th><a href="nojs.php" onclick="return dosort('trackerstatus')"
329 <?php echo ($form_orderby == "trackerstatus") ? " style=\"color:#00cc00\"" : ""; ?>><?php echo xlt('Status'); ?></a>
330 </th>
331 <?php } else { ?>
332 <th><a href="nojs.php" onclick="return dosort('trackerstatus')"
333 <?php echo ($form_orderby == "trackerstatus") ? " style=\"color:#00cc00\"" : ""; ?>><?php echo xlt('Final Status'); ?></a>
334 </th>
335 <?php } ?>
338 <th><?php
339 if ($chk_show_details) { # not sure if Sorting by Arrive Time is useful
340 echo xlt('Start Time');
341 } else {
342 echo xlt('Arrive Time');
343 }?></th>
345 <th><?php
346 if ($chk_show_details) { # not sure if Sorting by Discharge Time is useful
347 echo xlt('End Time');
348 } else {
349 echo xlt('Discharge Time');
350 }?></th>
352 <th><?php echo xlt('Total Time'); # not adding Sorting by Total Time yet but can see that it might be useful ?></th>
354 <?php } else { # this section is for the drug screen report ?>
356 <th><a href="nojs.php" onclick="return dosort('doctor')"
357 <?php echo ($form_orderby == "doctor") ? " style=\"color:#00cc00\"" : ""; ?>><?php echo xlt('Provider'); ?>
358 </a></th>
360 <th><a href="nojs.php" onclick="return dosort('date')"
361 <?php echo ($form_orderby == "date") ? " style=\"color:#00cc00\"" : ""; ?>><?php echo xlt('Date'); ?></a>
362 </th>
364 <th><a href="nojs.php" onclick="return dosort('time')"
365 <?php echo ($form_orderby == "time") ? " style=\"color:#00cc00\"" : ""; ?>><?php echo xlt('Time'); ?></a>
366 </th>
368 <th><a href="nojs.php" onclick="return dosort('patient')"
369 <?php echo ($form_orderby == "patient") ? " style=\"color:#00cc00\"" : ""; ?>>&nbsp;&nbsp;&nbsp;&nbsp;<?php echo xlt('Patient'); ?></a>
370 </th>
372 <?php if (!$chk_show_completed_drug_screens) { ?>
373 <th><a href="nojs.php" onclick="return dosort('pubpid')"
374 <?php echo ($form_orderby == "pubpid") ? " style=\"color:#00cc00\"" : ""; ?>>&nbsp;<?php echo xlt('ID'); ?></a>
375 </th>
376 <?php } else { ?>
377 <th><a href="nojs.php" onclick="return dosort('pubpid')"
378 <?php echo ($form_orderby == "pubpid") ? " style=\"color:#00cc00\"" : ""; ?>>&nbsp;<?php echo xlt('ID'); ?></a>
379 </th>
380 <?php } ?>
382 <th><?php echo xlt('Drug Screen'); # not sure if Sorting by Drug Screen is useful ?></th>
384 <?php if (!$chk_show_completed_drug_screens) { ?>
385 <th>&nbsp;</th>
386 <?php } else { ?>
387 <th><a href="nojs.php" onclick="return dosort('completed')"
388 <?php echo ($form_orderby == "completed") ? " style=\"color:#00cc00\"" : ""; ?>><?php echo xlt('Completed'); ?></a>
389 </th>
390 <?php } ?>
392 <th></th><th></th><th></th>
394 <?php } ?>
395 </thead>
396 <tbody>
397 <!-- added for better print-ability -->
398 <?php
400 $lastdocname = "";
401 #Appointment Status Checking
402 $form_apptstatus = $_POST['form_apptstatus'];
403 $form_apptcat=null;
404 if (isset($_POST['form_apptcat'])) {
405 if ($form_apptcat!="ALL") {
406 $form_apptcat=intval($_POST['form_apptcat']);
410 #Without provider and facility data checking
411 $with_out_provider = null;
412 $with_out_facility = null;
414 # get the appointments also set the trackerboard flag to true (last entry in the fetchAppointments call so we get the tracker stuff)
415 $appointments = fetchAppointments($from_date, $to_date, $patient, $provider, $facility, $form_apptstatus, $with_out_provider, $with_out_facility, $form_apptcat, true);
416 # sort the appointments by the appointment time
417 $appointments = sortAppointments($appointments, $form_orderby);
418 # $j is used to count the number of patients that match the selected criteria.
419 $j=0;
420 //print_r2($appointments);
421 foreach ($appointments as $appointment) {
422 $patient_id = $appointment['pid'];
423 $tracker_id = $appointment['pt_tracker_id'];
424 $last_seq = $appointment['lastseq'];
425 $docname = $appointment['ulname'] . ', ' . $appointment['ufname'] . ' ' . $appointment['umname'];
426 # only get items with a tracker id.
427 if ($tracker_id == '') {
428 continue;
431 # only get the drug screens that are set to yes.
432 if ($chk_show_drug_screens ==1) {
433 if ($appointment['random_drug_test'] != '1') {
434 continue;
438 #if a patient id is entered just get that patient.
439 if (strlen($form_pid) !=0) {
440 if ($appointment['pid'] != $form_pid) {
441 continue;
445 $errmsg = "";
446 $newarrive = '';
447 $newend = '';
448 $no_visit = 1;
449 # getting arrive time and end time from the elements file.
450 if ($tracker_id != 0) {
451 $newarrive = collect_checkin($tracker_id);
452 $newend = collect_checkout($tracker_id);
455 if ($newend != '' && $newarrive != '') {
456 $no_visit = 0;
459 $tracker_status = $appointment['status'];
460 # get the time interval for the entire visit. to display seconds add last option of true.
461 # get_Tracker_Time_Interval($newarrive, $newend, true)
462 $timecheck2 = get_Tracker_Time_Interval($newarrive, $newend);
463 # Get the tracker elements.
464 $tracker_elements = collect_Tracker_Elements($tracker_id);
465 # $j is incremented for a patient that made it for display.
466 $j=$j+1;
469 <tr bgcolor='<?php echo $bgcolor ?>'>
470 <?php
471 if (!$chk_show_drug_screens && !$chk_show_completed_drug_screens) { # the first part of this block is for the Patient Flow Board report ?>
472 <td class="detail">&nbsp;<?php echo ($docname == $lastdocname) ? "" : $docname ?>
473 </td>
475 <td class="detail"><?php echo text(oeFormatShortDate($appointment['pc_eventDate'])) ?>
476 </td>
478 <td class="detail"><?php echo text(oeFormatTime($appointment['pc_startTime'])) ?>
479 </td>
481 <td class="detail">&nbsp;<?php echo text($appointment['fname'] . " " . $appointment['lname']) ?>
482 </td>
484 <td class="detail">&nbsp;<?php echo text($appointment['pubpid']) ?>
485 </td>
487 <td class="detail">&nbsp;<?php echo text(xl_appt_category($appointment['pc_catname'])) ?>
488 </td>
490 <td class="detail">
491 <?php
492 //Appointment Status
493 if ($chk_show_details) {
494 if ($no_visit != 1) {
495 echo xlt('Complete Visit Time');
497 } else {
498 if ($tracker_status != "") {
499 echo getListItemTitle('apptstat', $tracker_status);
503 </td>
505 <td class="detail">&nbsp;<?php echo text(substr($newarrive, 11)) ?>
506 </td>
508 <td class="detail">&nbsp;<?php echo text(substr($newend, 11)) ?>
509 </td>
511 <?php if ($no_visit != 1) { ?>
512 <td class="detail">&nbsp;<?php echo text($timecheck2) ?></td>
513 <?php } else { ?>
514 <td class="detail">&nbsp;</td>
515 <?php } ?>
516 <?php
517 if ($chk_show_details) { # lets show the detail lines
518 $i = '0';
519 $k = '0';
520 for ($x = 1; $x <= $last_seq; $x++) {
522 <tr valign='top' class="detail" >
523 <td colspan="6" class="detail" align='left'>
525 <?php
526 # get the verbiage for the status code
527 $track_stat = $tracker_elements[$i][status];
528 # Get Interval alert time and status color.
529 $colorevents = (collectApptStatusSettings($track_stat));
530 $alert_time = '0';
531 $alert_color = $colorevents['color'];
532 $alert_time = $colorevents['time_alert'];
533 if (is_checkin($track_stat) || is_checkout($track_stat)) { #bold the check in and check out times in this block.
535 <td class="detail"><b>
536 <?php
537 } else { ?>
538 <td class="detail">
539 <?php
542 echo getListItemTitle("apptstat", $track_stat);
544 </b></td>
545 <?php
546 if (is_checkin($track_stat) || is_checkout($track_stat)) { #bold the check in and check out times in this block.
548 <td class="detail"><b>&nbsp;<?php echo text(substr($tracker_elements[$i][start_datetime], 11)); ?></b></td>
549 <?php
550 } else { ?>
551 <td class="detail">&nbsp;<?php echo text(substr($tracker_elements[$i][start_datetime], 11)); ?></td>
552 <?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];
560 } else {
561 # since this is the last status the start and end are equal
562 $start_tracker_time = $tracker_elements[$i][start_datetime];
563 $next_tracker_time = $tracker_elements[$i][start_datetime];
566 if (is_checkin($track_stat) || is_checkout($track_stat)) { #bold the check in and check out times in this block. ?>
567 <td class="detail"><b>&nbsp;<?php echo text(substr($next_tracker_time, 11)) ?></b></td><?php
568 } else { ?>
569 <td class="detail">&nbsp;<?php echo text(substr($next_tracker_time, 11)) ?></td>
570 <?php # compute the total time of the status
573 $tracker_time = get_Tracker_Time_Interval($start_tracker_time, $next_tracker_time);
574 # add code to alert if over time interval for status
575 $timecheck = round(abs(strtotime($start_tracker_time) - strtotime($next_tracker_time)) / 60, 0);
576 if ($timecheck > $alert_time && ($alert_time != '0')) {
577 if (is_checkin($track_stat) || is_checkout($track_stat)) { #bold the check in and check out times in this block. ?>
578 <td class="detail" bgcolor='<?php echo attr($alert_color) ?>'><b>&nbsp;<?php echo text($tracker_time); ?></b></td><?php
579 } else { ?>
580 <td class="detail" bgcolor='<?php echo attr($alert_color) ?>'>&nbsp;<?php echo text($tracker_time); ?></td><?php
582 } else {
583 if (is_checkin($track_stat) || is_checkout($track_stat)) { #bold the check in and check out times in this block. ?>
584 <td class="detail"><b>&nbsp;<?php echo text($tracker_time); ?></b></td><?php
585 } else { ?>
586 <td class="detail">&nbsp;<?php echo text($tracker_time); ?></td><?php
590 $i++;
594 </td>
595 </tr>
597 <?php
598 } 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 echo ($appointment['random_drug_test'] == '1') ? xlt('Yes') : xlt('No'); ?></td>
616 <?php if ($chk_show_completed_drug_screens) { ?>
617 <td class="detail">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<?php echo ($appointment['drug_screen_completed'] == '1') ? xlt('Yes') : 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 -->
646 <?php } else { ?>
647 <div class='text'><?php echo xlt('Please input search criteria above, and click Submit to view results.'); ?>
648 </div>
649 <?php } ?> <input type="hidden" name="form_orderby"
650 value="<?php echo attr($form_orderby) ?>" /> <input type="hidden"
651 name="patient" value="<?php echo attr($patient) ?>" /> <input type='hidden'
652 name='form_refresh' id='form_refresh' value='' /></form>
654 </body>
656 </html>