Changes to the Clients>Clinical report
[openemr.git] / interface / de_identification_forms / re_identification_input_screen.php
bloba1ab15d53b85b237f667c926feb4b5c5bcc9aca5
1 <?php
2 /********************************************************************************\
3 * Copyright (C) ViCarePlus, Visolve (vicareplus_engg@visolve.com) *
4 * *
5 * 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 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the Free Software *
17 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
18 \********************************************************************************/
19 require_once("../globals.php");
20 require_once("$srcdir/lists.inc");
21 require_once("$srcdir/patient.inc");
22 require_once("$srcdir/acl.inc");
23 require_once("$srcdir/options.inc.php");
24 require_once("$srcdir/translation.inc.php");
26 <html>
27 <head>
28 <title><?php xl('Re Identification','e'); ?></title>
29 <link rel="stylesheet" href='<?php echo $css_header ?>' type='text/css'>
30 <link rel="stylesheet"
31 href='<?php echo $GLOBALS['webroot'] ?>/library/dynarch_calendar.css'
32 type='text/css'>
34 <script type="text/javascript" src="<?php echo $GLOBALS['webroot'] ?>/library/dialog.js"></script>
36 <style type="text/css">
37 .style1 {
38 text-align: center;
40 </style>
41 <script language="JavaScript">
42 function form_validate()
45 if(document.forms[0].re_id_code.value == "undefined" || document.forms[0].re_id_code.value == "")
47 alert("<?php echo xl('Enter the Re Identification code');?>");
48 return false;
50 top.restoreSession();
51 return true;
54 function download_file()
56 alert("<?php echo xl('Re-identification files will be saved in'); echo ' `'.$GLOBALS['temporary_files_dir'].'` '; echo xl('location of the openemr machine and may contain sensitive data, so it is recommended to manually delete the files after its use');?>");
57 document.re_identification.submit();
60 </script>
61 </head>
62 <body class="body_top">
63 <strong><?php xl('Re Identification','e'); ?></strong>
64 <div id="overDiv"
65 style="position: absolute; visibility: hidden; z-index: 1000;"></div>
66 <form name="re_identification" enctype="Re_identification_ip_single_code"
67 action="re_identification_op_single_patient.php" method="POST" onsubmit="return form_validate();"><?php
68 $row = sqlQuery("SHOW TABLES LIKE 'de_identification_status'");
69 if (empty($row))
72 <table> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr>
73 <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr>
74 </table>
75 <table class="de_identification_status_message" align="center" >
76 <tr valign="top">
77 <td>&nbsp;</td>
78 <td rowspan="3">
79 <br>
80 <?php echo xl('Please upgrade OpenEMR Database to include De Identification procedures, function, tables'); ?>
81 </br></br><a target="Blank" href="../../contrib/util/de_identification_upgrade.php"><?php echo xl('Click here');?></a>
82 <?php echo xl('to run');
83 echo " de_identification_upgrade.php</br>";?><br>
84 </td>
85 <td>&nbsp;</td>
86 </tr>
87 <tr>
88 <td>&nbsp;</td>
89 <td>&nbsp;</td>
90 </tr>
91 <tr>
92 <td>&nbsp;</td>
93 <td>&nbsp;</td>
94 </tr>
95 </table>
96 <?php
98 else {
99 $query = "select status from re_identification_status";
100 $res = sqlStatement($query);
101 if ($row = sqlFetchArray($res))
103 $reIdentificationStatus = addslashes($row['status']);
104 /* $reIdentificationStatus:
105 * 0 - There is no Re Identification in progress. (start new Re Identification process)
106 * 1 - A Re Identification process is currently in progress.
107 * 2 - The Re Identification process completed and xls file is ready to download
111 if($reIdentificationStatus == 1)
113 //1 - A Re Identification process is currently in progress
115 <table>
116 <tr>
117 <td>&nbsp;</td>
118 <td>&nbsp;</td>
119 </tr>
120 <tr>
121 <td>&nbsp;</td>
122 <td>&nbsp;</td>
123 </tr>
124 </table>
125 <table class="de_identification_status_message" align="center">
126 <tr valign="top">
127 <td>&nbsp;</td>
128 <td rowspan="3"><br>
129 <?php echo xl('Re Identification Process is ongoing');
130 echo "</br></br>";
131 echo xl('Please visit Re Identification screen after some time');
132 echo "</br>"; ?> <br>
133 </td>
134 <td>&nbsp;</td>
135 </tr>
136 <tr>
137 <td>&nbsp;</td>
138 <td>&nbsp;</td>
139 </tr>
140 <tr>
141 <td>&nbsp;</td>
142 <td>&nbsp;</td>
143 </tr>
144 </table>
145 <?php
147 else if($reIdentificationStatus == 0)
149 //0 - There is no Re Identification in progress. (start new Re Identification process)
151 <center></br>
152 </br>
153 <?php xl('Enter the Re Identification code','e'); ?> <input
154 type='text' size='50' name='re_id_code' id='re_id_code'
155 title='<?php xl('Enter the Re Identification code','e'); ?>' /> </br>
156 </br>
157 <Input type="Submit" Name="Submit" Value=<?php echo xl("submit");?>></center>
158 <?php
160 else if($reIdentificationStatus == 2)
162 //2 - The Re Identification process completed and xls file is ready to download
163 $query = "SELECT count(*) as count FROM re_identified_data ";
164 $res = sqlStatement($query);
165 if ($row = sqlFetchArray($res))
167 $no_of_items = addslashes($row['count']);
169 if($no_of_items <= 1)
171 //start new search - no patient record fount
172 $query = "update re_identification_status set status = 0";
173 $res = sqlStatement($query);
175 <table>
176 <tr>
177 <td>&nbsp;</td>
178 <td>&nbsp;</td>
179 </tr>
180 <tr>
181 <td>&nbsp;</td>
182 <td>&nbsp;</td>
183 </tr>
184 </table>
185 <table class="de_identification_status_message" align="center">
186 <tr valign="top">
187 <td>&nbsp;</td>
188 <td rowspan="3"><br>
189 <?php echo xl('No Patient record found for the given Re Identification code');
190 echo "</br></br>";
191 echo xl('Please enter the correct Re Identification code');
192 echo "</br>"; ?> </br>
193 </td>
194 <td>&nbsp;</td>
195 </tr>
196 <tr>
197 <td>&nbsp;</td>
198 <td>&nbsp;</td>
199 </tr>
200 <tr>
201 <td>&nbsp;</td>
202 <td>&nbsp;</td>
203 </tr>
204 </table>
205 <table align="center">
206 <tr>
207 <td>&nbsp;</td>
208 <td>&nbsp;</td>
209 </tr>
210 </table>
212 <?php
214 else {
216 <table>
217 <tr>
218 <td>&nbsp;</td>
219 <td>&nbsp;</td>
220 </tr>
221 <tr>
222 <td>&nbsp;</td>
223 <td>&nbsp;</td>
224 </tr>
225 </table>
226 <table class="de_identification_status_message"" align="center">
227 <tr valign="top">
228 <td>&nbsp;</td>
229 <td rowspan="3"><br>
230 <?php echo xl('Re Identification Process is completed');
231 echo "</br></br>";
232 echo xl('Please Click download button to download the Re Identified data');
233 echo "</br>"; ?> <br>
234 </td>
235 <td>&nbsp;</td>
236 </tr>
237 <tr>
238 <td>&nbsp;</td>
239 <td>&nbsp;</td>
240 </tr>
241 <tr>
242 <td>&nbsp;</td>
243 <td>&nbsp;</td>
244 </tr>
245 </table>
246 <table align="center">
247 <tr>
248 <td>&nbsp;</td>
249 <td>&nbsp;</td>
250 </tr>
251 <tr>
252 <td colspan="2" class="style1"><input type="button" name="Download"
253 value=<?php echo xl("Download"); ?> onclick="download_file()" ></td>
254 </tr>
255 </table>
256 <?php
262 </form>
263 </body>
264 </html>