2 include_once("../../globals.php");
3 include_once("$srcdir/log.inc");
4 include_once("$srcdir/billing.inc");
5 include_once("$srcdir/forms.inc");
6 include_once("$srcdir/pnotes.inc");
7 include_once("$srcdir/transactions.inc");
8 include_once("$srcdir/lists.inc");
9 include_once("$srcdir/patient.inc");
10 include_once("$srcdir/options.inc.php");
12 //the number of authorizations to display in the quick view:
13 // MAR 20041008 the full authorizations screen sucks... no links to the patient charts
14 // increase to a high number to make the mini frame more useful.
17 $atemp = sqlQuery("SELECT see_auth FROM users WHERE username = '" .
18 $_SESSION['authUser'] . "'");
19 $see_auth = $atemp['see_auth'];
21 $imauthorized = $_SESSION['userauthorized'] ||
$see_auth > 2;
23 // This authorizes everything for the specified patient.
24 if (isset($_GET["mode"]) && $_GET["mode"] == "authorize" && $imauthorized) {
25 $retVal = getProviderId($_SESSION['authUser']);
26 newEvent("authorize", $_SESSION["authUser"], $_SESSION["authProvider"], $_GET["pid"]);
27 // sqlStatement("update billing set authorized=1, provider_id = '" .
28 // mysql_real_escape_string($retVal[0]['id']) .
29 // "' where pid='" . $_GET["pid"] . "'");
30 sqlStatement("update billing set authorized=1 where pid='" . $_GET["pid"] . "'");
31 sqlStatement("update forms set authorized=1 where pid='" . $_GET["pid"] . "'");
32 sqlStatement("update pnotes set authorized=1 where pid='" . $_GET["pid"] . "'");
33 sqlStatement("update transactions set authorized=1 where pid='" . $_GET["pid"] . "'");
38 <?php
html_header_show();?
>
39 <link rel
='stylesheet' href
="<?php echo $css_header;?>" type
="text/css">
40 <script type
="text/javascript" src
="<?php echo $GLOBALS['webroot'] ?>/library/js/jquery-1.2.2.min.js"></script
>
42 /* min & max buttons are hidden in the newer concurrent layout */
47 cursor
: pointer
; cursor
: hand
;
48 <?php
if ($GLOBALS['concurrent_layout']) echo "display: none;"; ?
>
54 cursor
: pointer
; cursor
: hand
;
55 <?php
if ($GLOBALS['concurrent_layout']) echo "display: none;"; ?
>
59 <body
class="body_bottom">
61 <!-- 'buttons' to min
/max the bottom frame
-JRM
-->
62 <div id
="max" title
="Restore this information">
63 <img src
="<?php echo $GLOBALS['webroot']; ?>/images/max.gif">
65 <div id
="min" title
="Minimize this information">
66 <img src
="<?php echo $GLOBALS['webroot']; ?>/images/min.gif">
70 $_GET['show_all']=='yes' ?
$lnkvar="'authorizations.php?show_all=no' name='Just Mine'> (".xl('Just Mine').") " : $lnkvar="'authorizations.php?show_all=yes' name='See All'>(".xl('See All').")";
73 <span
class='title'><?php
xl('Patient Notes','e')?
> </span
>
74 <a
class='more' href
=<?php
echo $lnkvar; ?
></a
>
76 <?php
if ($imauthorized) { ?
>
77 <span
class='title'><?php
xl('and ','e')?
>
78 <?php
if ($GLOBALS['concurrent_layout']) { ?
>
79 <a href
='authorizations_full.php'>
81 <a href
='authorizations_full.php' target
='Main'>
83 <?php
xl('Authorizations','e')?
> <span
class='more'><?php
echo $tmore;?
></span
></a
>
89 <?php
if (!$GLOBALS['concurrent_layout']) { ?
>
90 <span
class='more'>  
;
91 <a href
="#" id
="findpatients" name
='Find Patients'>(<?php
xl('Find Patient','e')?
>)</a
>
97 // Retrieve all active notes addressed to me (or to anybody)
98 $_GET['show_all']=='yes' ?
$usrvar='_%' : $usrvar=$_SESSION['authUser'] ;
99 if ($result=getPnotesByDate("", 1, "id,date,body,pid,user,title,assigned_to", '%', "all", 0, $usrvar))
101 echo "<table border='0'>\n";
103 echo " <td class='bold' nowrap>".xl('Patient')." </td>\n";
104 echo " <td class='bold' nowrap>".xl('Note Type')." </td>\n";
105 echo " <td class='bold' nowrap>".xl('Timestamp and Text')."</td>\n";
108 foreach ($result as $iter) {
109 $body = $iter['body'];
110 if (preg_match('/^\d\d\d\d-\d\d-\d\d \d\d\:\d\d /', $body)) {
111 $body = nl2br($body);
113 $body = date('Y-m-d H:i', strtotime($iter['date'])) .
114 ' (' . $iter['user'] . ') ' . nl2br($body);
117 echo " <tr class='noterow' id='".$iter['pid']."~".$iter['id']."'>\n";
118 echo " <td valign='top' class='text'>\n";
119 echo getPatientName($iter['pid']) . "\n";
121 echo " <td valign='top'>\n";
123 if ($GLOBALS['concurrent_layout']) {
124 // Modified 6/2009 by BM to incorporate the patient notes into the list_options listings
125 echo " <a href='../../patient_file/summary/pnotes_full.php" .
126 "?set_pid=" . $iter['pid'] . "¬eid=" . $iter['id'] .
127 "&active=1' class='link_submit'>" .
128 generate_display_field(array('data_type'=>'1','list_id'=>'note_type'), $iter['title']) .
131 // Modified 6/2009 by BM to incorporate the patient notes into the list_options listings
132 echo " <a href='../../patient_file/patient_file.php" .
133 "?set_pid=" . $iter['pid'] . "¬eid=" . $iter['id'] .
134 "' target='_top' class='link_submit'>" .
135 generate_display_field(array('data_type'=>'1','list_id'=>'note_type'), $iter['title']) .
140 echo " <td valign='top' class='text'>\n";
149 </div
> <!-- end of pnotes
-->
152 if ($imauthorized && $see_auth > 1) {
160 //fetch billing information:
161 if ($res = sqlStatement("select *, concat(u.fname,' ', u.lname) as user " .
162 "from billing LEFT JOIN users as u on billing.user = u.id where " .
163 "billing.authorized = 0 and billing.activity = 1 and " .
164 "groupname = '$groupname'"))
166 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
167 $result1[$iter] = $row;
169 foreach ($result1 as $iter) {
170 $authorize{$iter{"pid"}}{"billing"} .= "<span class=text>" .
171 $iter{"code_text"} . " " . date("n/j/Y",strtotime($iter{"date"})) .
174 //$authorize[$iter{"pid"}]{"billing"} = substr($authorize[$iter{"pid"}]{"billing"},0,strlen($authorize[$iter{"pid"}]{"billing"}));
178 //fetch transaction information:
179 if ($res = sqlStatement("select * from transactions where " .
180 "authorized = 0 and groupname = '$groupname'"))
182 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
183 $result2[$iter] = $row;
185 foreach ($result2 as $iter) {
186 $authorize{$iter{"pid"}}{"transaction"} .= "<span class=text>" .
187 $iter{"title"} . ": " . stripslashes(strterm($iter{"body"},25)) .
188 " " . date("n/j/Y",strtotime($iter{"date"})) . "</span><br>\n";
190 //$authorize[$iter{"pid"}]{"transaction"} = substr($authorize[$iter{"pid"}]{"transaction"},0,strlen($authorize[$iter{"pid"}]{"transaction"}));
194 if (empty($GLOBALS['ignore_pnotes_authorization'])) {
195 //fetch pnotes information:
196 if ($res = sqlStatement("select * from pnotes where authorized = 0 and " .
197 "groupname = '$groupname'"))
199 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
200 $result3[$iter] = $row;
202 foreach ($result3 as $iter) {
203 $authorize{$iter{"pid"}}{"pnotes"} .= "<span class=text>" .
204 stripslashes(strterm($iter{"body"},25)) . " " .
205 date("n/j/Y",strtotime($iter{"date"})) . "</span><br>\n";
207 //$authorize[$iter{"pid"}]{"pnotes"} = substr($authorize[$iter{"pid"}]{"pnotes"},0,strlen($authorize[$iter{"pid"}]{"pnotes"}));
212 //fetch forms information:
213 if ($res = sqlStatement("select * from forms where authorized = 0 and " .
214 "groupname = '$groupname'"))
216 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
217 $result4[$iter] = $row;
219 foreach ($result4 as $iter) {
220 $authorize{$iter{"pid"}}{"forms"} .= "<span class=text>" .
221 $iter{"form_name"} . " " . date("n/j/Y",strtotime($iter{"date"})) .
224 //$authorize[$iter{"pid"}]{"forms"} = substr($authorize[$iter{"pid"}]{"forms"},0,strlen($authorize[$iter{"pid"}]{"forms"}));
227 // echo "HERE"; // what the heck was this for?
230 <table border
='0' cellpadding
='0' cellspacing
='2' width
='100%'>
238 while (list($ppid,$patient) = each($authorize)) {
239 $name = getPatientData($ppid);
241 // If I want to see mine only and this patient is not mine, skip it.
242 if ($see_auth == 2 && $_SESSION['authUserID'] != $name['id'])
246 print "<tr><td colspan='5' align='center'><a" .
247 ($GLOBALS['concurrent_layout'] ?
"" : " target='Main'") .
248 " href='authorizations_full.php?active=1' class='alert'>" .
249 xl('Some authorizations were not displayed. Click here to view all') .
254 echo "<tr><td valign='top'>";
255 if ($GLOBALS['concurrent_layout']) {
256 // Clicking the patient name will load both frames for that patient,
257 // as demographics.php takes care of loading the bottom frame.
258 // larry :: dbc change here
259 if( $GLOBALS['dutchpc'] )
261 echo "<a href='$rootdir/patient_file/summary/demographics_dutch.php?set_pid=$ppid' " .
265 echo "<a href='$rootdir/patient_file/summary/demographics.php?set_pid=$ppid' " .
268 // larry :: end of dbc change
271 echo "<a href='$rootdir/patient_file/patient_file.php?set_pid=$ppid' " .
274 echo "<span class='bold'>" . $name{"fname"} . " " .
275 $name{"lname"} . "</span></a><br>" .
276 "<a class=link_submit href='authorizations.php?mode=authorize" .
277 "&pid=$ppid'>" . xl('Authorize') . "</a></td>\n";
280 //Michael A Rowley MD 20041012.
281 // added below 4 lines to add provider to authorizations for ez reference.
282 $providerID = sqlFetchArray(sqlStatement(
283 "select providerID from patient_data where pid=$ppid"));
284 $userID=$providerID{"providerID"};
285 $providerName = sqlFetchArray(sqlStatement(
286 "select lname from users where id=$userID"));
288 // Don't use sqlQuery because there might be no match.
289 $providerName = sqlFetchArray(sqlStatement(
290 "select lname from users where id = '" . $name['providerID'] . "'"));
293 echo "<td valign=top><span class=bold>".xl('Provider').":</span><span class=text><br>" .
294 $providerName{"lname"} . "</td>\n";
295 // ha ha, see if that works....mar.
296 echo "<td valign=top><span class=bold>".xl('Billing').":</span><span class=text><br>" .
297 $patient{"billing"} . "</td>\n";
298 echo "<td valign=top><span class=bold>".xl('Transactions').":</span><span class=text><br>" .
299 $patient{"transaction"} . "</td>\n";
300 echo "<td valign=top><span class=bold>".xl('Patient Notes').":</span><span class=text><br>" .
301 $patient{"pnotes"} . "</td>\n";
302 echo "<td valign=top><span class=bold>".xl('Encounter Forms').":</span><span class=text><br>" .
303 $patient{"forms"} . "</td>\n";
319 <script language
='JavaScript'>
321 /* added to adjust the height of this frame by the min/max buttons */
323 $
(document
).ready(function(){
324 $
("#findpatients").click(function() { RestoreFrame(this
); document
.location
.href
='../calendar/find_patient.php?no_nav=1&mode=reset'; return true; });
326 $
(".noterow").mouseover(function() { $
(this
).toggleClass("highlight"); });
327 $
(".noterow").mouseout(function() { $
(this
).toggleClass("highlight"); });
328 $
(".noterow").click(function() { EditNote(this
); });
330 <?php
if ($GLOBALS['concurrent_layout'] == 0) : ?
>
331 $
("#min").click(function() { MinimizeFrame(this
); });
332 $
("#max").click(function() { RestoreFrame(this
); });
333 var frmset
= parent
.document
.getElementById('Main');
334 origRows
= frmset
.rows
; // save the original frameset sizes
338 <?php
if ($GLOBALS['concurrent_layout'] == 0) : ?
>
339 var MinimizeFrame
= function(eventObject
) {
340 var frmset
= parent
.document
.getElementById('Main');
341 origRows
= frmset
.rows
; // save the original frameset sizes
342 frmset
.rows
= "*, 10%";
344 var RestoreFrame
= function(eventObject
) {
345 // restore the original frameset size
346 var frmset
= parent
.document
.getElementById('Main');
347 if (origRows
!= null) { frmset
.rows
= origRows
; }
351 var EditNote
= function(note
) {
352 var parts
= note
.id
.split("~");
354 top
.restoreSession();
355 <?php
if ($GLOBALS['concurrent_layout']): ?
>
356 location
.href
= "<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/summary/pnotes_full.php?noteid=" + parts
[1] +
"&set_pid=" + parts
[0] +
"&active=1";
358 top
.location
.href
= "<?php echo $GLOBALS['webroot']; ?>/interface/patient_file/patient_file.php?noteid=" + parts
[1] +
"&set_pid=" + parts
[0];
362 alert("<?php xl('You do not have access to view/edit this note','e'); ?>");