2 // Copyright (C) 2008-2015 Rod Roark <rod@sunsetsystems.com>
4 // This program is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU General Public License
6 // as published by the Free Software Foundation; either version 2
7 // of the License, or (at your option) any later version.
9 // This reports checkins and checkouts for a specified patient's chart.
12 require_once("../globals.php");
13 require_once("$srcdir/patient.inc");
14 require_once("$srcdir/options.inc.php");
16 use OpenEMR\Core\Header
;
17 use OpenEMR\Services\PatientService
;
19 $form_patient_id = trim($_POST['form_patient_id']);
23 <title
><?php
echo xlt('Chart Location Activity'); ?
></title
>
25 <?php Header
::setupHeader(); ?
>
27 <style type
="text/css">
29 /* specifically include & exclude from printing */
35 #report_parameters_daterange {
39 #report_results table {
44 /* specifically exclude some from the screen */
46 #report_parameters_daterange {
54 <script language
="JavaScript">
55 $
(document
).ready(function() {
56 var win
= top
.printLogSetup ? top
: opener
.top
;
57 win
.printLogSetup(document
.getElementById('printbutton'));
63 <body
class="body_top">
65 <span
class='title'><?php
echo xlt('Report'); ?
> - <?php
echo xlt('Chart Location Activity'); ?
></span
>
70 if (!empty($form_patient_id)) {
71 $query = "SELECT pid, pubpid, fname, mname, lname FROM patient_data WHERE " .
72 "pubpid = ? ORDER BY pid LIMIT 1";
73 $ptrow = sqlQuery($query, array($form_patient_id));
76 echo "<font color='red'>" . xlt('Chart ID') . " '" . text($form_patient_id) . "' " . xlt('not found!') . "</font><br /> <br />";
78 $curr_pid = $ptrow['pid'];
80 } else if (!empty($curr_pid)) {
81 $query = "SELECT pid, pubpid, fname, mname, lname FROM patient_data WHERE " .
83 $ptrow = sqlQuery($query, array($curr_pid));
84 $form_patient_id = $ptrow['pubpid'];
88 echo '<span class="title">' . text(xl('for', '', '', ' '));
89 echo text($ptrow['lname']) . ', ' . text($ptrow['fname']) . ' ' . text($ptrow['mname']) . ' ';
90 echo "(" . text($ptrow['pubpid']) . ")";
95 <div id
="report_parameters_daterange">
98 <form name
='theform' id
='theform' method
='post' action
='chart_location_activity.php' onsubmit
='return top.restoreSession()'>
100 <div id
="report_parameters">
102 <input type
='hidden' name
='form_refresh' id
='form_refresh' value
=''/>
106 <div style
='float:left'>
110 <td
class='control-label'>
111 <?php
echo xlt('Patient ID'); ?
>:
114 <input type
='text' name
='form_patient_id' class='form-control' size
='10' maxlength
='31' value
='<?php echo attr($form_patient_id) ?>'
115 title
='<?php echo xla('Patient ID
'); ?>' />
123 <td align
='left' valign
='middle' height
="100%">
124 <table style
='border-left:1px solid; width:100%; height:100%' >
127 <div
class="text-center">
128 <div
class="btn-group" role
="group">
129 <a href
='#' class='btn btn-default btn-save' onclick
='$("#form_refresh").attr("value","true"); $("#theform").submit();'>
130 <?php
echo xlt('Submit'); ?
>
132 <?php
if ($_POST['form_refresh'] ||
!empty($ptrow)) { ?
>
133 <a href
='#' class='btn btn-default btn-print' id
='printbutton'>
134 <?php
echo xlt('Print'); ?
>
146 </div
> <!-- end of parameters
-->
149 if ($_POST['form_refresh'] ||
!empty($ptrow)) {
151 <div id
="report_results">
154 <th
> <?php
echo xlt('Time'); ?
> </th
>
155 <th
> <?php
echo xlt('Destination'); ?
> </th
>
160 if (!empty($ptrow)) {
161 $res = PatientService
::getChartTrackerInformationActivity($curr_pid);
162 while ($row = sqlFetchArray($res)) {
166 <?php
echo text(oeFormatShortDate(substr($row['ct_when'], 0, 10))) . text(substr($row['ct_when'], 10)); ?
>
170 if (!empty($row['ct_location'])) {
171 echo generate_display_field(array('data_type'=>'1','list_id'=>'chartloc'), $row['ct_location']);
172 } else if (!empty($row['ct_userid'])) {
173 echo text($row['lname']) . ', ' . text($row['fname']) . ' ' . text($row['mname']);
184 </div
> <!-- end of results
-->
187 <?php
echo xlt('Please input search criteria above, and click Submit to view results.'); ?
>