bug: fix typo in 837I script (#7469)
[openemr.git] / interface / de_identification_forms / re_identification_input_screen.php
blob526ba4bbabf76494ce682314c36fe639a86d7fb8
1 <?php
3 /**
4 * re_identification_input_screen.php
6 * @package OpenEMR
7 * @link http://www.open-emr.org
8 * @author Visolve <vicareplus_engg@visolve.com>
9 * @author Brady Miller <brady.g.miller@gmail.com>
10 * @copyright Copyright (c) 2010 ViCarePlus, Visolve <vicareplus_engg@visolve.com>
11 * @copyright Copyright (c) 2018-2019 Brady Miller <brady.g.miller@gmail.com>
12 * @license https://github.com/openemr/openemr/blob/master/LICENSE GNU General Public License 3
15 require_once("../globals.php");
16 require_once("$srcdir/lists.inc.php");
17 require_once("$srcdir/patient.inc.php");
18 require_once("$srcdir/options.inc.php");
20 use OpenEMR\Common\Acl\AclMain;
21 use OpenEMR\Common\Csrf\CsrfUtils;
22 use OpenEMR\Common\Twig\TwigContainer;
23 use OpenEMR\Core\Header;
25 if (!AclMain::aclCheckCore('admin', 'super')) {
26 echo (new TwigContainer(null, $GLOBALS['kernel']))->getTwig()->render('core/unauthorized.html.twig', ['pageTitle' => xl("Re Identification")]);
27 exit;
31 <html>
32 <head>
33 <title><?php echo xlt('Re Identification'); ?></title>
35 <?php Header::setupHeader(); ?>
37 <style>
38 .style1 {
39 text-align: center;
41 </style>
42 <script>
43 function form_validate()
46 if(document.forms[0].re_id_code.value == "undefined" || document.forms[0].re_id_code.value == "")
48 alert(<?php echo xlj('Enter the Re Identification code'); ?>);
49 return false;
51 top.restoreSession();
52 return true;
55 function download_file()
57 alert(<?php echo xlj('Re-identification files will be saved in'); ?> + ' `' + <?php echo js_escape($GLOBALS['temporary_files_dir']); ?> + '` ' + <?php echo xlj('location of the openemr machine and may contain sensitive data, so it is recommended to manually delete the files after its use'); ?>);
58 document.re_identification.submit();
61 </script>
62 </head>
63 <body class="body_top">
64 <strong><?php echo xlt('Re Identification'); ?></strong>
65 <div id="overDiv"
66 style="position: absolute; visibility: hidden; z-index: 1000;"></div>
67 <form name="re_identification" enctype="Re_identification_ip_single_code"
68 action="re_identification_op_single_patient.php" method="POST" onsubmit="return form_validate();">
69 <input type="hidden" name="csrf_token_form" value="<?php echo attr(CsrfUtils::collectCsrfToken()); ?>" />
70 <?php
71 $row = sqlQuery("SHOW TABLES LIKE 'de_identification_status'");
72 if (empty($row)) {
74 <table> <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr>
75 <tr> <td>&nbsp;</td> <td>&nbsp;</td> </tr>
76 </table>
77 <table class="de_identification_status_message" align="center" >
78 <tr valign="top">
79 <td>&nbsp;</td>
80 <td rowspan="3">
81 <br />
82 <?php echo xlt('Please upgrade OpenEMR Database to include De Identification procedures, function, tables'); ?>
83 <br /><br /><a target="Blank" href="../../contrib/util/de_identification_upgrade.php"><?php echo xlt('Click here');?></a>
84 <?php echo xlt('to run');
85 echo " de_identification_upgrade.php<br />";?><br />
86 </td>
87 <td>&nbsp;</td>
88 </tr>
89 <tr>
90 <td>&nbsp;</td>
91 <td>&nbsp;</td>
92 </tr>
93 <tr>
94 <td>&nbsp;</td>
95 <td>&nbsp;</td>
96 </tr>
97 </table>
98 <?php
99 } else {
100 $query = "select status from re_identification_status";
101 $res = sqlStatement($query);
102 if ($row = sqlFetchArray($res)) {
103 $reIdentificationStatus = $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) {
112 //1 - A Re Identification process is currently in progress
114 <table>
115 <tr>
116 <td>&nbsp;</td>
117 <td>&nbsp;</td>
118 </tr>
119 <tr>
120 <td>&nbsp;</td>
121 <td>&nbsp;</td>
122 </tr>
123 </table>
124 <table class="de_identification_status_message" align="center">
125 <tr valign="top">
126 <td>&nbsp;</td>
127 <td rowspan="3"><br />
128 <?php echo xlt('Re Identification Process is ongoing');
129 echo "<br /><br />";
130 echo xlt('Please visit Re Identification screen after some time');
131 echo "<br />"; ?> <br />
132 </td>
133 <td>&nbsp;</td>
134 </tr>
135 <tr>
136 <td>&nbsp;</td>
137 <td>&nbsp;</td>
138 </tr>
139 <tr>
140 <td>&nbsp;</td>
141 <td>&nbsp;</td>
142 </tr>
143 </table>
144 <?php
145 } elseif ($reIdentificationStatus == 0) {
146 //0 - There is no Re Identification in progress. (start new Re Identification process)
148 <center><br />
149 <br />
150 <?php echo xlt('Enter the Re Identification code'); ?> <input
151 type='text' size='50' name='re_id_code' id='re_id_code'
152 title='<?php echo xla('Enter the Re Identification code'); ?>' /> <br />
153 <br />
154 <Input type="Submit" Name="Submit" Value=<?php echo xla("submit");?>></center>
155 <?php
156 } elseif ($reIdentificationStatus == 2) {
157 //2 - The Re Identification process completed and xls file is ready to download
158 $query = "SELECT count(*) as count FROM re_identified_data ";
159 $res = sqlStatement($query);
160 if ($row = sqlFetchArray($res)) {
161 $no_of_items = $row['count'];
164 if ($no_of_items <= 1) {
165 //start new search - no patient record fount
166 $query = "update re_identification_status set status = 0";
167 $res = sqlStatement($query);
169 <table>
170 <tr>
171 <td>&nbsp;</td>
172 <td>&nbsp;</td>
173 </tr>
174 <tr>
175 <td>&nbsp;</td>
176 <td>&nbsp;</td>
177 </tr>
178 </table>
179 <table class="de_identification_status_message" align="center">
180 <tr valign="top">
181 <td>&nbsp;</td>
182 <td rowspan="3"><br />
183 <?php echo xlt('No Patient record found for the given Re Identification code');
184 echo "<br /><br />";
185 echo xlt('Please enter the correct Re Identification code');
186 echo "<br />"; ?> <br />
187 </td>
188 <td>&nbsp;</td>
189 </tr>
190 <tr>
191 <td>&nbsp;</td>
192 <td>&nbsp;</td>
193 </tr>
194 <tr>
195 <td>&nbsp;</td>
196 <td>&nbsp;</td>
197 </tr>
198 </table>
199 <table align="center">
200 <tr>
201 <td>&nbsp;</td>
202 <td>&nbsp;</td>
203 </tr>
204 </table>
206 <?php
207 } else {
209 <table>
210 <tr>
211 <td>&nbsp;</td>
212 <td>&nbsp;</td>
213 </tr>
214 <tr>
215 <td>&nbsp;</td>
216 <td>&nbsp;</td>
217 </tr>
218 </table>
219 <table class="de_identification_status_message"" align="center">
220 <tr valign="top">
221 <td>&nbsp;</td>
222 <td rowspan="3"><br />
223 <?php echo xlt('Re Identification Process is completed');
224 echo "<br /><br />";
225 echo xlt('Please Click download button to download the Re Identified data');
226 echo "<br />"; ?> <br />
227 </td>
228 <td>&nbsp;</td>
229 </tr>
230 <tr>
231 <td>&nbsp;</td>
232 <td>&nbsp;</td>
233 </tr>
234 <tr>
235 <td>&nbsp;</td>
236 <td>&nbsp;</td>
237 </tr>
238 </table>
239 <table align="center">
240 <tr>
241 <td>&nbsp;</td>
242 <td>&nbsp;</td>
243 </tr>
244 <tr>
245 <td colspan="2" class="style1"><input type="button" name="Download"
246 value=<?php echo xla("Download"); ?> onclick="download_file()" ></td>
247 </tr>
248 </table>
249 <?php
255 </form>
256 </body>
257 </html>