fixes for prior commit - moved Documents menu item to Procedures->Lab documents
[openemr.git] / interface / patient_file / ccr_pending_approval.php
blobc71b6641ae4755b15cdded61accde0503e01ac17
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
26 //SANITIZE ALL ESCAPES
27 $sanitize_all_escapes=true;
30 //STOP FAKE REGISTER GLOBALS
31 $fake_register_globals=false;
34 require_once(dirname(__FILE__) . "/../globals.php");
35 require_once(dirname(__FILE__) . "/../../library/options.inc.php");
36 require_once(dirname(__FILE__) . "/../../library/patient.inc");
37 require_once(dirname(__FILE__) . "/../../library/parse_patient_xml.php");
39 if($_REQUEST['approve'] == 1){
40 insert_patient($_REQUEST['am_id']);
42 <html>
43 <head>
44 <title><?php echo xlt('CCR Approve');?></title>
45 <link rel="stylesheet" href="<?php echo $css_header; ?>" type="text/css" >
46 </head>
47 <body class="body_top" >
48 <center><?php echo xlt('Approved Successfully'); ?></center>
49 </body>
50 </html>
51 <?php
52 exit;
56 <html>
57 <head>
58 <title><?php echo xlt('Pending Approval');?></title>
59 <link rel="stylesheet" href="<?php echo $css_header; ?>" type="text/css">
60 <style>
62 table {
63 color: #000;
64 font: .8em/1.6em "Trebuchet MS",Verdana,sans-serif;
65 border-collapse: collapse;
66 margin: 0 auto;
67 border: 1px solid #CCC;
70 tbody th,td {
71 border-left: 0;
72 padding: 8px
75 tbody{
76 background: rgb(255,255,255); /* Old browsers */
77 background: -moz-linear-gradient(top, rgba(255,255,255,1) 0%, rgba(229,229,229,1) 100%); /* FF3.6+ */
78 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+ */
79 background: -webkit-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* Chrome10+,Safari5.1+ */
80 background: -o-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* Opera 11.10+ */
81 background: -ms-linear-gradient(top, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* IE10+ */
82 background: linear-gradient(to bottom, rgba(255,255,255,1) 0%,rgba(229,229,229,1) 100%); /* W3C */
83 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ffffff', endColorstr='#e5e5e5',GradientType=0 ); /* IE6-9 */
86 tbody th {
87 color: #3e3e3e;
88 padding: 5px 10px;
89 background: #f5f6f6; /* Old browsers */
90 background: -moz-linear-gradient(top, #f5f6f6 0%, #dbdce2 21%, #b8bac6 49%, #dddfe3 80%, #f5f6f6 100%); /* FF3.6+ */
91 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+ */
92 background: -webkit-linear-gradient(top, #f5f6f6 0%,#dbdce2 21%,#b8bac6 49%,#dddfe3 80%,#f5f6f6 100%); /* Chrome10+,Safari5.1+ */
93 background: -o-linear-gradient(top, #f5f6f6 0%,#dbdce2 21%,#b8bac6 49%,#dddfe3 80%,#f5f6f6 100%); /* Opera 11.10+ */
94 background: -ms-linear-gradient(top, #f5f6f6 0%,#dbdce2 21%,#b8bac6 49%,#dddfe3 80%,#f5f6f6 100%); /* IE10+ */
95 background: linear-gradient(to bottom, #f5f6f6 0%,#dbdce2 21%,#b8bac6 49%,#dddfe3 80%,#f5f6f6 100%); /* W3C */
96 filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#f5f6f6', endColorstr='#f5f6f6',GradientType=0 ); /* IE6-9 */
97 border-bottom: 1px solid;
100 tbody tr.odd {
101 background-color: #F7F7F7;
102 color: #666
105 .button-link {
106 padding: 3px 10px;
107 background: #c0c0c0;
108 color: #000 !important;
109 -webkit-border-radius: 4px;
110 -moz-border-radius: 4px;
111 border-radius: 4px;
112 border: solid 1px #000000;
113 -webkit-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
114 -moz-box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
115 box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4), 0 1px 1px rgba(0, 0, 0, 0.2);
116 -webkit-transition-duration: 0.2s;
117 -moz-transition-duration: 0.2s;
118 transition-duration: 0.2s;
119 -webkit-user-select:none;
120 -moz-user-select:none;
121 -ms-user-select:none;
122 user-select:none;
125 .button-link:hover {
126 background: #808080;
127 border: solid 1px #000000;
128 text-decoration: none;
129 color: #FFF !important;
132 </style>
133 <script type="text/javascript" >
135 </script>
136 </head>
137 <body class="body_top" >
138 <center>
139 <p><b><?php echo xlt('Pending Approval');?></b></p>
140 </center>
141 <form method="post" name="approve" "onsubmit='return top.restoreSession()'" >
142 <center>
143 <table style="width:80%;" border="0" >
144 <tr>
145 <th>
146 <?php echo xlt('Patient Name'); ?>
147 </th>
148 <th>
149 <?php echo xlt('Match Found'); ?>
150 </th>
151 <th>
152 <?php echo xlt('Action'); ?>
153 </th>
154 </tr>
155 <?php
156 $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
157 ad.audit_master_id = am.id AND ad.table_name = 'patient_data' AND ad.field_name = 'lname' JOIN audit_details ad1 ON
158 ad1.audit_master_id = am.id AND ad1.table_name = 'patient_data' AND ad1.field_name = 'fname' WHERE type='11' AND approval_status='1'");
159 if(sqlNumRows($query) > 0){
160 while($res = sqlFetchArray($query)){
161 $dup_query = sqlStatement("SELECT * FROM audit_master am JOIN audit_details ad ON ad.audit_master_id = am.id AND ad.table_name = 'patient_data'
162 AND ad.field_name = 'lname' JOIN audit_details ad1 ON ad1.audit_master_id = am.id AND ad1.table_name = 'patient_data' AND
163 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'
164 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 = ?",
165 array($res['amid']));
167 <tr>
168 <td class="bold" >
169 <?php echo text($res['pat_name']); ?>
170 </td>
171 <?php
172 if(sqlNumRows($dup_query)>0){
173 $dup_res = sqlFetchArray($dup_query);
175 <td align="center" class="bold" >
176 <?php echo xlt('Yes'); ?>
177 </td>
178 <td align="center" >
179 <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>
180 </td>
181 <?php
182 }else{
184 <td align="center" class="bold" >
185 <?php echo xlt('No'); ?>
186 </td>
187 <td align="center" >
188 <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>
189 </td>
190 <?php
193 </tr>
194 <?php
196 }else{
198 <tr>
199 <td colspan="3" >
200 <?php echo xlt('Nothing Pending for Approval')."."; ?>
201 </td>
202 </tr>
203 <?php
206 </table>
207 </center>
208 </form>
209 </body>
210 </html>