Highway to PSR2
[openemr.git] / interface / patient_file / ccr_pending_approval.php
blobf9d596f421ac4cb1d819c24ba7647383022d0b73
1 <?php
2 /**
3 * interface/patient_file/ccr_pending_approval.php Approval screen for uploaded CCR XML.
5 * Approval screen for uploaded CCR XML.
7 * Copyright (C) 2013 Z&H Consultancy Services Private Limited <sam@zhservices.com>
9 * LICENSE: This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 3
12 * of the License, or (at your option) any later version.
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
20 * @package OpenEMR
21 * @author Eldho Chacko <eldho@zhservices.com>
22 * @author Ajil P M <ajilpm@zhservices.com>
23 * @link http://www.open-emr.org
28 require_once(dirname(__FILE__) . "/../globals.php");
29 require_once(dirname(__FILE__) . "/../../library/options.inc.php");
30 require_once(dirname(__FILE__) . "/../../library/patient.inc");
31 require_once(dirname(__FILE__) . "/../../library/parse_patient_xml.php");
33 if ($_REQUEST['approve'] == 1) {
34 insert_patient($_REQUEST['am_id']);
36 <html>
37 <head>
38 <title><?php echo xlt('CCR Approve');?></title>
39 <link rel="stylesheet" href="<?php echo $css_header; ?>" type="text/css" >
40 </head>
41 <body class="body_top" >
42 <center><?php echo xlt('Approved Successfully'); ?></center>
43 </body>
44 </html>
45 <?php
46 exit;
50 <html>
51 <head>
52 <title><?php echo xlt('Pending Approval');?></title>
53 <link rel="stylesheet" href="<?php echo $css_header; ?>" type="text/css">
54 <style>
56 table {
57 color: #000;
58 font: .8em/1.6em "Trebuchet MS",Verdana,sans-serif;
59 border-collapse: collapse;
60 margin: 0 auto;
61 border: 1px solid #CCC;
64 tbody th,td {
65 border-left: 0;
66 padding: 8px
69 tbody{
70 background: rgb(255,255,255); /* Old browsers */
71 background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(229,229,229,1) 100%); /* FF3.6+ */
72 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(255,255,255,1)), color-stop(100%,rgba(229,229,229,1))); /* Chrome,Safari4+ */
73 background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* Chrome10+,Safari5.1+ */
74 background: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* Opera 11.10+ */
75 background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* IE10+ */
76 background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* W3C */
77 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=0 ); /* IE6-9 */
80 tbody th {
81 color: #3e3e3e;
82 padding: 5px 10px;
83 background: #f5f6f6; /* Old browsers */
84 background: -moz-linear-gradient(top, #f5f6f6 0%, #dbdce2 21%, #b8bac6 49%, #dddfe3 80%, #f5f6f6 100%); /* FF3.6+ */
85 background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#f5f6f6), color-stop(21%,#dbdce2), color-stop(49%,#b8bac6), color-stop(80%,#dddfe3), color-stop(100%,#f5f6f6)); /* Chrome,Safari4+ */
86 background: -webkit-linear-gradient(top, #f5f6f6 0%,#dbdce2 21%,#b8bac6 49%,#dddfe3 80%,#f5f6f6 100%); /* Chrome10+,Safari5.1+ */
87 background: -o-linear-gradient(top, #f5f6f6 0%,#dbdce2 21%,#b8bac6 49%,#dddfe3 80%,#f5f6f6 100%); /* Opera 11.10+ */
88 background: -ms-linear-gradient(top, #f5f6f6 0%,#dbdce2 21%,#b8bac6 49%,#dddfe3 80%,#f5f6f6 100%); /* IE10+ */
89 background: linear-gradient(to bottom, #f5f6f6 0%,#dbdce2 21%,#b8bac6 49%,#dddfe3 80%,#f5f6f6 100%); /* W3C */
90 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f6f6', endColorstr='#f5f6f6',GradientType=0 ); /* IE6-9 */
91 border-bottom: 1px solid;
94 tbody tr.odd {
95 background-color: #F7F7F7;
96 color: #666
99 .button-link {
100 padding: 3px 10px;
101 background: #c0c0c0;
102 color: #000 !important;
103 -webkit-border-radius: 4px;
104 -moz-border-radius: 4px;
105 border-radius: 4px;
106 border: solid 1px #000000;
107 -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
108 -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
109 box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
110 -webkit-transition-duration: 0.2s;
111 -moz-transition-duration: 0.2s;
112 transition-duration: 0.2s;
113 -webkit-user-select:none;
114 -moz-user-select:none;
115 -ms-user-select:none;
116 user-select:none;
119 .button-link:hover {
120 background: #808080;
121 border: solid 1px #000000;
122 text-decoration: none;
123 color: #FFF !important;
126 </style>
127 <script type="text/javascript" >
129 </script>
130 </head>
131 <body class="body_top" >
132 <center>
133 <p><b><?php echo xlt('Pending Approval');?></b></p>
134 </center>
135 <form method="post" name="approve" "onsubmit='return top.restoreSession()'" >
136 <center>
137 <table style="width:80%;" border="0" >
138 <tr>
139 <th>
140 <?php echo xlt('Patient Name'); ?>
141 </th>
142 <th>
143 <?php echo xlt('Match Found'); ?>
144 </th>
145 <th>
146 <?php echo xlt('Action'); ?>
147 </th>
148 </tr>
149 <?php
150 $query = sqlStatement("SELECT *,am.id amid,CONCAT(ad.field_value,' ',ad1.field_value) as pat_name FROM audit_master am JOIN audit_details ad ON
151 ad.audit_master_id = am.id AND ad.table_name = 'patient_data' AND ad.field_name = 'lname' JOIN audit_details ad1 ON
152 ad1.audit_master_id = am.id AND ad1.table_name = 'patient_data' AND ad1.field_name = 'fname' WHERE type='11' AND approval_status='1'");
153 if (sqlNumRows($query) > 0) {
154 while ($res = sqlFetchArray($query)) {
155 $dup_query = sqlStatement(
156 "SELECT * FROM audit_master am JOIN audit_details ad ON ad.audit_master_id = am.id AND ad.table_name = 'patient_data'
157 AND ad.field_name = 'lname' JOIN audit_details ad1 ON ad1.audit_master_id = am.id AND ad1.table_name = 'patient_data' AND
158 ad1.field_name = 'fname' JOIN audit_details ad2 ON ad2.audit_master_id = am.id AND ad2.table_name = 'patient_data' AND ad2.field_name = 'DOB'
159 JOIN patient_data pd ON pd.lname = ad.field_value AND pd.fname = ad1.field_value AND pd.DOB = DATE(ad2.field_value) WHERE am.id = ?",
160 array($res['amid'])
163 <tr>
164 <td class="bold" >
165 <?php echo text($res['pat_name']); ?>
166 </td>
167 <?php
168 if (sqlNumRows($dup_query)>0) {
169 $dup_res = sqlFetchArray($dup_query);
171 <td align="center" class="bold" >
172 <?php echo xlt('Yes'); ?>
173 </td>
174 <td align="center" >
175 <a href="ccr_review_approve.php?revandapprove=1&amid=<?php echo attr($res['amid']); ?>&pid=<?php echo attr($dup_res['pid']); ?>" class="button-link" onclick="top.restoreSession()" ><?php echo xlt('Review & Approve'); ?></a>
176 </td>
177 <?php
178 } else {
180 <td align="center" class="bold" >
181 <?php echo xlt('No'); ?>
182 </td>
183 <td align="center" >
184 <a href="ccr_pending_approval.php?approve=1&am_id=<?php echo attr($res['amid']); ?>" class="button-link" onclick="top.restoreSession()" ><?php echo xlt('Approve'); ?></a>
185 </td>
186 <?php
189 </tr>
190 <?php
192 } else {
194 <tr>
195 <td colspan="3" >
196 <?php echo xlt('Nothing Pending for Approval')."."; ?>
197 </td>
198 </tr>
199 <?php
202 </table>
203 </center>
204 </form>
205 </body>
206 </html>