3 * Authorizations full script.
5 * LICENSE: This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
17 * @author Brady Miller <brady@sparmy.com>
18 * @link http://www.open-emr.org
21 //SANITIZE ALL ESCAPES
22 $sanitize_all_escapes=true;
25 //STOP FAKE REGISTER GLOBALS
26 $fake_register_globals=false;
29 include_once("../../globals.php");
30 include_once("$srcdir/patient.inc");
32 if (isset($_GET["mode"]) && $_GET["mode"] == "authorize") {
33 newEvent("authorize",$_SESSION["authUser"],$_SESSION["authProvider"],1,$_GET["pid"]);
34 sqlStatement("update billing set authorized=1 where pid=?", array($_GET["pid"]) );
35 sqlStatement("update forms set authorized=1 where pid=?", array($_GET["pid"]) );
36 sqlStatement("update pnotes set authorized=1 where pid=?", array($_GET["pid"]) );
37 sqlStatement("update transactions set authorized=1 where pid=?", array($_GET["pid"]) );
43 <?php
html_header_show();?
>
44 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
46 <body
class="body_top">
48 <a href
="authorizations.php" onclick
='top.restoreSession()'>
49 <font
class=title
><?php
echo htmlspecialchars(xl('Authorizations'),ENT_NOQUOTES
); ?
></font
>
50 <font
class=more
><?php
echo htmlspecialchars($tback,ENT_NOQUOTES
); ?
></font
></a
>
58 //fetch billing information:
59 if ($res = sqlStatement("select *, concat(u.fname,' ', u.lname) as user from billing LEFT JOIN users as u on billing.user = u.id where billing.authorized=0 and groupname=?", array ($groupname) )) {
60 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
61 $result[$iter] = $row;
64 foreach ($result as $iter) {
66 $authorize{$iter{"pid"}}{"billing"} .= "<span class=small>" .
67 htmlspecialchars($iter{"user"},ENT_NOQUOTES
) . ": </span><span class=text>" .
68 htmlspecialchars($iter{"code_text"} . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES
) .
76 //fetch transaction information:
77 if ($res = sqlStatement("select * from transactions where authorized=0 and groupname=?", array($groupname) )) {
78 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
79 $result2[$iter] = $row;
82 foreach ($result2 as $iter) {
84 $authorize{$iter{"pid"}}{"transaction"} .= "<span class=small>" .
85 htmlspecialchars($iter{"user"},ENT_NOQUOTES
) . ": </span><span class=text>" .
86 htmlspecialchars($iter{"title"} . ": " . strterm($iter{"body"},25) . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES
) .
94 if (empty($GLOBALS['ignore_pnotes_authorization'])) {
95 //fetch pnotes information, exclude ALL deleted notes
96 if ($res = sqlStatement("select * from pnotes where authorized=0 and deleted!=1 and groupname=?", array($groupname) )) {
97 for ($iter = 0;$row = sqlFetchArray($res);$iter++
) $result3[$iter] = $row;
99 foreach ($result3 as $iter) {
100 $authorize{$iter{"pid"}}{"pnotes"} .= "<span class=small>" .
101 htmlspecialchars($iter{"user"},ENT_NOQUOTES
) . ": </span><span class=text>" .
102 htmlspecialchars(strterm($iter{"body"},25) . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES
) .
109 //fetch forms information:
110 if ($res = sqlStatement("select * from forms where authorized=0 and groupname=?", array($groupname) )) {
111 for ($iter = 0;$row = sqlFetchArray($res);$iter++
)
112 $result4[$iter] = $row;
115 foreach ($result4 as $iter) {
117 $authorize{$iter{"pid"}}{"forms"} .= "<span class=small>" .
118 htmlspecialchars($iter{"user"},ENT_NOQUOTES
) . ": </span><span class=text>" .
119 htmlspecialchars($iter{"form_name"} . " " . date("n/j/Y",strtotime($iter{"date"})),ENT_NOQUOTES
) .
128 <table border
=0 cellpadding
=0 cellspacing
=2 width
=100%
>
135 while(list($ppid,$patient) = each($authorize)){
137 $name = getPatientData($ppid);
139 echo "<tr><td valign=top><span class=bold>". htmlspecialchars($name{"fname"} . " " . $name{"lname"},ENT_NOQUOTES
) .
140 "</span><br><a class=link_submit href='authorizations_full.php?mode=authorize&pid=" .
141 htmlspecialchars($ppid,ENT_QUOTES
) . "' onclick='top.restoreSession()'>" . htmlspecialchars(xl('Authorize'),ENT_NOQUOTES
) . "</a></td>\n";
142 echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Billing'),ENT_NOQUOTES
).
143 ":</span><span class=text><br>" . $patient{"billing"} . "</td>\n";
144 echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Transactions'),ENT_NOQUOTES
).
145 ":</span><span class=text><br>" . $patient{"transaction"} . "</td>\n";
146 echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Patient Notes'),ENT_NOQUOTES
).
147 ":</span><span class=text><br>" . $patient{"pnotes"} . "</td>\n";
148 echo "<td valign=top><span class=bold>".htmlspecialchars(xl('Encounter Forms'),ENT_NOQUOTES
).
149 ":</span><span class=text><br>" . $patient{"forms"} . "</td>\n";