3 * Authorizations full script.
6 * @link http://www.open-emr.org
7 * @author Brady Miller <brady.g.miller@gmail.com>
8 * @copyright Copyright (c) 2018 Brady Miller <brady.g.miller@gmail.com>
9 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
13 require_once("../../globals.php");
14 require_once("$srcdir/patient.inc");
16 if (isset($_GET["mode"]) && $_GET["mode"] == "authorize") {
17 if (!verifyCsrfToken($_GET["csrf_token_form"])) {
18 die(xlt('Authentication Error'));
21 newEvent("authorize", $_SESSION["authUser"], $_SESSION["authProvider"], 1, '', $_GET["pid"]);
22 sqlStatement("update billing set authorized=1 where pid=?", array($_GET["pid"]));
23 sqlStatement("update forms set authorized=1 where pid=?", array($_GET["pid"]));
24 sqlStatement("update pnotes set authorized=1 where pid=?", array($_GET["pid"]));
25 sqlStatement("update transactions set authorized=1 where pid=?", array($_GET["pid"]));
30 <?php
html_header_show();?
>
31 <link rel
="stylesheet" href
="<?php echo $css_header;?>" type
="text/css">
33 <body
class="body_top">
35 <a href
="authorizations.php" onclick
='top.restoreSession()'>
36 <font
class=title
><?php
echo xlt('Authorizations'); ?
></font
>
37 <font
class=more
><?php
echo text($tback); ?
></font
></a
>
45 //fetch billing information:
46 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))) {
47 for ($iter = 0; $row = sqlFetchArray($res); $iter++
) {
48 $result[$iter] = $row;
52 foreach ($result as $iter) {
53 $authorize{$iter{"pid"}}{"billing"} .= "<span class=small>" .
54 text($iter{"user"}) . ": </span><span class=text>" .
55 text($iter{"code_text"} . " " . date("n/j/Y", strtotime($iter{"date"}))) .
61 //fetch transaction information:
62 if ($res = sqlStatement("select * from transactions where authorized=0 and groupname=?", array($groupname))) {
63 for ($iter = 0; $row = sqlFetchArray($res); $iter++
) {
64 $result2[$iter] = $row;
68 foreach ($result2 as $iter) {
69 $authorize{$iter{"pid"}}{"transaction"} .= "<span class=small>" .
70 text($iter{"user"}) . ": </span><span class=text>" .
71 text($iter{"title"} . ": " . strterm($iter{"body"}, 25) . " " . date("n/j/Y", strtotime($iter{"date"}))) .
77 if (empty($GLOBALS['ignore_pnotes_authorization'])) {
78 //fetch pnotes information, exclude ALL deleted notes
79 if ($res = sqlStatement("select * from pnotes where authorized=0 and deleted!=1 and groupname=?", array($groupname))) {
80 for ($iter = 0; $row = sqlFetchArray($res);
82 $result3[$iter] = $row;
86 foreach ($result3 as $iter) {
87 $authorize{$iter{"pid"}}{"pnotes"} .= "<span class=small>" .
88 text($iter{"user"}) . ": </span><span class=text>" .
89 text(strterm($iter{"body"}, 25) . " " . date("n/j/Y", strtotime($iter{"date"}))) .
96 //fetch forms information:
97 if ($res = sqlStatement("select * from forms where authorized=0 and groupname=?", array($groupname))) {
98 for ($iter = 0; $row = sqlFetchArray($res); $iter++
) {
99 $result4[$iter] = $row;
103 foreach ($result4 as $iter) {
104 $authorize{$iter{"pid"}}{"forms"} .= "<span class=small>" .
105 text($iter{"user"}) . ": </span><span class=text>" .
106 text($iter{"form_name"} . " " . date("n/j/Y", strtotime($iter{"date"}))) .
113 <table border
=0 cellpadding
=0 cellspacing
=2 width
=100%
>
119 while (list($ppid,$patient) = each($authorize)) {
120 $name = getPatientData($ppid);
122 echo "<tr><td valign=top><span class=bold>". text($name{"fname"} . " " . $name{"lname"}) .
123 "</span><br><a class=link_submit href='authorizations_full.php?mode=authorize&pid=" .
124 attr(urlencode($ppid)) . "&csrf_token_form=" . attr(urlencode(collectCsrfToken())) . "' onclick='top.restoreSession()'>" . xlt('Authorize') . "</a></td>\n";
125 echo "<td valign=top><span class=bold>".xlt('Billing').
126 ":</span><span class=text><br>" . $patient{"billing"} . "</td>\n";
127 echo "<td valign=top><span class=bold>".xlt('Transactions').
128 ":</span><span class=text><br>" . $patient{"transaction"} . "</td>\n";
129 echo "<td valign=top><span class=bold>".xlt('Patient Notes').
130 ":</span><span class=text><br>" . $patient{"pnotes"} . "</td>\n";
131 echo "<td valign=top><span class=bold>".xlt('Encounter Forms').
132 ":</span><span class=text><br>" . $patient{"forms"} . "</td>\n";